Ticket #3167 (closed bug: fixed)
z.indexOf is not a function
| Reported by: | hkirsman | Owned by: | flesler |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3 |
| Component: | selector | Version: | 1.2.6 |
| Keywords: | select input | Cc: | hkirsman |
| Blocking: | Blocked by: |
Description
PROBLEM a specific jquery select and form with name=name gives "z.indexOf is not a function" error
CURRENT WORKAROUND - add form in front of the query
Attachments
Change History
comment:1 Changed 5 years ago by Markus.Staab
the input field in your testcase should have the name "blah", not name.
comment:2 Changed 5 years ago by flesler
- need changed from Patch to Test Case
- Resolution set to invalid
- Status changed from new to closed
- Component changed from core to selector
Right, I'll close for now.
Reopen this if you modify the test case and it still fails.
comment:3 Changed 5 years ago by vlad
- Status changed from closed to reopened
- Resolution invalid deleted
Guys, thank you for the awesome library!
This specific bug hits me big time and as I deal with the code form other developers, which I have limited access to, it makes it worse.
See the attached bug file - it works without the form, while failing with the form. The query has nothing to do with the form! In my case, the form is someone else's code!
The way to debug the problem is the following (my page is huge, so can not do it by breakpoints):
In jquery-1.2.6.js, after the following text at lines 1709 - 1711:
if ( z == null || /href|src|selected/.test(m[2]) )
z = jQuery.attr(a,m[2]) || '';
Insert the debug catcher:
if (z !== z.toString()) {
$(z).addClass('bug3167');
z = z.toString();
}
Then, in the FireFox console, look for the elements $('.bug3167')
By the way, just brutally adding the line
z = z.toString();
, instead of the debug catcher after line 1711, saves it from aborting on 1717 (now 1718). Now, I think it is OK in my environment, but getting a proper fix would make me much more willing to release the code to production.
Changed 5 years ago by vlad
-
attachment
jqselecttest.html
added
Demo of selector failing on an unrelated to the selection elements
comment:4 Changed 5 years ago by flesler
- Cc hkirsman, flesler added
- Owner set to flesler
- Status changed from reopened to new
Yes, I think I saw this on another ticket. I pulled out the perfect solution, but it hits perfomance. Will handle this once I get a while.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

bug with selection of 'input type=text name=name '