1882 Posts in 643 Topics by 582 members
|Go to End|
22 August 2011 at 6:27pm
I'm trying jQuery Validate to limit the # of checkboxes a user can choose in my form (MultiForm module). To do that, the set of checkboxes need to have the same name=" " within the input.
<input name="tech" id="ebio" type="checkbox" value="" />
<input name="tech" id="mna" type="checkbox" value="" />
If I use something like $dataFieldByName(Bla) to generate the input field in the template, it doesn't allow me to specify the name part of the input that I know of.
If I write out the input manually, the checkbox state isn't being saved when I go to another page/step of the form and come back.
22 August 2011 at 8:59pm
To limit the user input with jQuery, simply count all checked children of .checkboxsetfield. Something like:
var count = $("ul.checkboxsetfield input:checked").length;
|Go to Top|