I have a form that shows/hides sections of the form based on checkbox select.
Part of the form that is hidden contains radio buttons:
<div class="input grid_4 alpha omega suffix_8">
<label>Company Name</label>
<div class="clear"></div>
<label class="radio inline">
<input type="radio" value="homeAddress" id="homeAddress" name="addressSelect">
Home </label>
<label class="radio inline">
<input type="radio" value="bizAddress" id="bizAddress" name="addressSelect">
Business </label>
</div>
When I show that part of the form, and interact with the radio buttons, I get the following error:
Error: element is undefined
Source File: …./js/jquery.validate.js
Line: 674
Line 674:
idOrName: function(element) {
return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
},
I tried ignoring the radio buttons based on name, but it still throws an error.
Additionally, if the radio buttons are not hidden (remove all show/hide functionality), there is no error.
Thoughts?
see fiddle: http://jsfiddle.net/jasonday/fBZQ3/
uncheck “this is also my shipping address” and then interact with the radio buttons.
I got no errors after simply assigning a name property to the checkbox.