karbassi/Custom-Form-Elements

Inputs with periods in name attribute cause custom form elements to break

webster opened this issue · 0 comments

I'm using Gravity Forms for WordPress, which generates inputs with names like input_5.1. Using Custom Form Elements to style a checkbox with that name, the checkbox is initially stylized as expected and as defined in CSS. I can click on it, and it toggles to the checked state as defined in CSS, but provides this error in the console:

Uncaught Error: Syntax error, unrecognized expression: .styled[type=radio][name=input_5.1]

Clicking on the element again to toggle back to an unchecked state provides the error in the console, but it does not toggle back to unchecked.

When I change the name of the element in Dev Tools to input_51 and cf.repaint(); it works flawlessly. Quotes (input[name="input_5.1"]) or escaping (input[name=input_5\\.1]) would resolve this.

Mac 10.8.2 + Chrome 26.0.1410.40 + jQuery 1.9.1