Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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 jitter)

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 8 years ago by Jörn.Berkefeld

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!

comment:2 Changed 8 years ago by jitter

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 8 years ago by jitter

Component: unfiledselector
Milestone: 1.next1.4.5
Priority: undecidedhigh
Resolution: duplicate
Status: newclosed

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:4 Changed 8 years ago by jitter

Duplicate of #7539.

comment:5 Changed 8 years ago by john

Version: 1.4.41.5

There wasn't a 1.4.5 release, was actually 1.5.

comment:6 Changed 8 years ago by john

Milestone: 1.4.51.5

There was no 1.4.5 release, was actually 1.5.

Note: See TracTickets for help on using tickets.