Bug Tracker

Modify

Ticket #5503 (closed bug: worksforme)

Opened 4 years ago

Last modified 4 years ago

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

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

Change History

Changed 4 years ago by jonliss

test case illustrates failure

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.

 http://docs.jquery.com/Selectors

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.