Validate Conditional

Validate Conditional

Hi,

I am using the validate plugin  http://bassistance.de/jquery-plugins/jquery-plugin-validation/ and would like to use some conditional validation, if a user does not select an option from the contact_person_id select field then they must enter something in both the input fields below it, what is the best way to achieve this, preferably with a warning message generated if the user tries to submit without either selecting an option or entering content in the two input fields.

Thanks,
Stuart

  1. <script type="text/javascript">
  2. ...
  3. jQuery("#manage_form").validate();
  4. ...
  5. </script>
  1. <form action="" method="post" id="manage_form">

  2. <select name="contact_person_id" id="contact_person_id">
  3.       <option value="">Please Select</option>
  4.       <option value="1234">Person</option>
  5. </select>

  6. <input type="text" name="contact_person_name" id="contact_person_name" />
  7. <input type="text" name="contact_person_email" id="contact_person_email" />

  8. </form>