Skip to main content

Bug Tracker

Side navigation

#5503 closed bug (worksforme)

Opened November 12, 2009 04:49PM UTC

Closed November 14, 2009 10:14PM UTC

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 November 12, 2009 04:49PM UTC.

    test case illustrates failure

Change History (1)

Changed November 14, 2009 10:14PM UTC by dmethvin comment:1

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