Ticket #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: | ||
| Blocking: | Blocked by: |
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
Change History
comment:1 Changed 4 years ago by dmethvin
- Status changed from new to closed
- Resolution set to worksforme
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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


test case illustrates failure