I have a multi-page form that first takes basic user information with some jquery.validate error checking to see if the fields are filled in and if the email address is valid.
Below is a series of checkboxes (type_of_request) for new accounts, account deletion, new software, etc. that show / hide these form elements as they are marked or not checked.
I would like to check the necessary sections in the form ONLY if the corressponding type_of_request element is checked.
Update info
This is a great solution, but it seems to require all the children of the selected section.
A typical scenario would be either an email flag or another flag in type_request:
<div id="email" style="display: block;">
<input id="email_new_account" class="sq-form-field" type="checkbox" value="0" name="q4836:q1"/>
<input id="email_new_account_name" class="sq-form-field" type="text" name="q4836:q2"/>
<input id="email_new_account_access" class="sq-form-field" type="text" name="q4836:q2"/>
<input id="email_new_account_manager" class="sq-form-field" type="text" name="q4836:q3"/>
<input id="email_add_remove_access" class="sq-form-field" type="checkbox" value="0" name="q4837:q1"/>
<input id="email_add_remove_account_name" class="sq-form-field" type="text" name="q4837:q2"/>
<input id="email_add_access" class="sq-form-field" type="text" name="q4836:q2"/>
<input id="email_remove_access" class="sq-form-field" type="text" name="q4837:q3"/>
</div>
<div id="other" style="display: block;">
<input id="other_describe_request" class="sq-form-field" type="text" name="q4838:q1"/>
<input id="other_request_justification" class="sq-form-field" type="text" name="q48387:q2"/>
</div>
, :
class="{required:true, messages:{required:'Please enter
your email address'}}"
class="{required:true, email:true, messages:{required:'Please enter
your email address', email:'Please enter a valid email address'}}"
class="{required:'input[@name=other]:checked'}"
http://jquery.bassistance.de, . , ?