#7691 closed bug (duplicate)
Selectors: meta-characters [ ] wont work (but did in 1.4.3)
Reported by: | Jörn.Berkefeld | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | selector | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
In my script I need to select a bunch of checkboxes named "ff_id[]
" with jQuery.
After I updated to 1.4.4 my script was broken. I tried the following:
alert('test1:'+$("input[name=ff_id\[\]]").length); alert('test2:'+$("input[name=ff_id\\[\\]]").length); alert('test3:'+$("input[name=ff_id[]]").length); alert('test4:'+$("input[name^=ff_id]").length);
In 1.4.3 all of the above return a number (in my testcase 16) while in 1.4.4 only the last one returned 16 while the rest returned 0
error tested in IE8, Chrome7 and FF3. Did not test it in any other browsers.
Change History (6)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Description: | modified (diff) |
---|
Fixed description.
The problems you experienced with the \\
and ^
originates from the fact that these characters have a special meaning in trac as they are used for formatting (trac wiki formatting).
comment:3 Changed 12 years ago by
Component: | unfiled → selector |
---|---|
Milestone: | 1.next → 1.4.5 |
Priority: | undecided → high |
Resolution: | → duplicate |
Status: | new → closed |
test1 and test3 are equivalent as the single backslash has no effect. test3 is a known regression, where an unquoted but escaped attribute value in an attribute selector doesn't work anymore. In the mean time you can use the selector with quoted attribute value like this $("input[name='ff_id[]']")
. Which is what the api docs advise you to do anyway.
So after checking your report and the test case I came to the conclusion that this bug was already reported.
Thus I close this ticket as duplicate. Please check the below mentioned ticket for progress on this issue.
comment:5 Changed 12 years ago by
Version: | 1.4.4 → 1.5 |
---|
There wasn't a 1.4.5 release, was actually 1.5.
comment:6 Changed 12 years ago by
Milestone: | 1.4.5 → 1.5 |
---|
There was no 1.4.5 release, was actually 1.5.
just saw, that the < (turned by 90 degrees clockwise) was removed by the forum in test4 it's supposed to check input tags with a name starting with "ff_id" there...
please fix the forum!