Results 1 to 1 of 1
Mar 30, 2011, 10:08 #1
- Join Date
- Apr 2010
- 0 Post(s)
- 0 Thread(s)
JQuery Validation plugin to require one of several checkboxes ticked
Bit of a clumsy title that...
Anyway what I'm trying to figure out is if there's any way I can make Validation require that one of a number of checkboxes (possibly grouped with a class) is checked. With radio buttons this is fairly straight forward but I also need possibly all the checkboxes ticked. An error would only be shown if none are checked.
<li><input type="checkbox" name="quoteFloatingShelves">Floating Shelves</li>
<li><input type="checkbox" name="quoteBookcases">Bookcases</li>
<li><input type="checkbox" name="quoteWardrobes">Wardrobes</li>
<li><input type="checkbox" name="quoteHallwaysStorage">Hallway Storage</li>
<li><input type="checkbox" name="quoteGeneralStorage">General Storage</li>
<li><input type="checkbox" name="quoteTVUnit">TV Unit</li>
<li><input type="checkbox" id="other_requirements" name="quoteOtherRequirementsTrue">Other (Please specify in "Notes" below)</li>
As I say these could be grouped together in a class for Validation to talk to. In all honesty I don't think this is possible but it would be far easier to do it all with Validation rather than try and write something from fresh and integrate it smoothly into how I have Validation looking.
I know I could do it with a multiple select box instead of checkboxes but my client doesn't like these as he says they are confusing (sigh...)
Thanks for any help.