Skip to main content

Bug Tracker

Side navigation

#8725 closed bug (invalid)

Opened March 31, 2011 09:21AM UTC

Closed March 31, 2011 11:56AM UTC

jQuery 1.5+ breaks working if ( is used in form element names

Reported by: Owned by:
Priority: undecided Milestone:
Component: unfiled Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:

I'm combining Struts and jQuery. In Struts it's best practice to use () in form element names if one wants to insert a value in a mapped object serverside on submit.

For instance <input type="hidden" name="queryCondition(7447).key" value="yes"/> will set the value yes on the property key on the object 7447 in the map queryCondition.

This works perfectly with jQuery 1.4.4 and earlier but upgrading to 1.5+ results in the following error in Firefox:

uncaught exception: Syntax error, unrecognized expression: [name = queryCondition(7447).key]

It is possible to get the old working handling back please - perhaps controlled by a setting?

Attachments (0)
Change History (2)

Changed March 31, 2011 11:54AM UTC by petersendidit comment:1

You just need to wrap the attribute value in quotes.


Changed March 31, 2011 11:56AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

Quote the attribute.

"Attributes should be identifiers or strings."