Skip to main content

Bug Tracker

Side navigation

#7691 closed bug (duplicate)

Opened December 03, 2010 12:50PM UTC

Closed December 03, 2010 02:24PM UTC

Last modified January 31, 2011 05:55PM UTC

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

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.

Attachments (0)
Change History (6)

Changed December 03, 2010 01:03PM UTC by Jörn.Berkefeld comment:1

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!

Changed December 03, 2010 02:15PM UTC by jitter comment:2

description: 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. \ \ remark: in this post i had to add extra spaces between the backslashes in test2 because it wouldnt show it correctly here. my actual test of course was without those spacesIn 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.

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).

Changed December 03, 2010 02:24PM UTC by jitter comment:3

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.

Changed December 03, 2010 02:24PM UTC by jitter comment:4

Duplicate of #7539.

Changed January 31, 2011 05:53PM UTC by john comment:5

version: 1.4.41.5

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

Changed January 31, 2011 05:55PM UTC by john comment:6

milestone: 1.4.51.5

There was no 1.4.5 release, was actually 1.5.