Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5503 closed bug (worksforme)

Selector against name fails if name contains period followed by square brackets

Reported by: jonliss Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

JQuery 1.3.2 fails if the name used in a selector contains a period followed by square brackets. Either on their own work as expected.

e.g.

$('input[name="foo[0]"]:checked').val() works. $('input[name="fee.foe"]:checked').val() works. $('input[name="bar.baz[0]"]:checked').val() fails.

Attached is a test html file illustrating failure, requires jquery-1.3.2.min.js in same directory.

Tested against Firefox 3.0.15 and IE 6.0.2900 with the same failing results.

Attachments (1)

test.html (1.7 KB) - added by jonliss 10 years ago.
test case illustrates failure

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by jonliss

Attachment: test.html added

test case illustrates failure

comment:1 Changed 10 years ago by dmethvin

Resolution: worksforme
Status: newclosed

For correct cross-browser operation, you must escape any special chars in the name. The W3C says that names can contain only alphanumeric chars, but jQuery allows them in selectors as long as they are escaped with
per the docs.

http://docs.jquery.com/Selectors

Note: See TracTickets for help on using tickets.