Bug Tracker

Opened 12 years ago

Closed 12 years ago

#8725 closed bug (invalid)

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

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.next
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?

Change History (2)

comment:1 Changed 12 years ago by petersendidit

You just need to wrap the attribute value in quotes.



comment:2 Changed 12 years ago by dmethvin

Resolution: invalid
Status: newclosed

Quote the attribute.


"Attributes should be identifiers or strings."

Note: See TracTickets for help on using tickets.