jQuery validator: Custom message based on radio selection

jQuery validator: Custom message based on radio selection

Hi

Example:

<fieldset>
<input type="radio" value="1" name="choice1"/>
<input type="radio" value="0" name="choice1"/>
</fieldset>
<fieldset>
<input type="radio" value="1" name="choice2"/>
<input type="radio" value="0" name="choice2"/>
</fieldset>


Two radio button groups, both required, and if you choose "1" on "choice1" you should choose "1" on the "choice2". "

My problem:
 input[name="choice2"][value="1"] should be :checked if input[name="choice1"][value="1"] is :checked,
AND
 display a message stating "If you choose 1 in choice1, then you have to choose 1 in choice2".

 I suspect this will require a good deal of custom methods and class rules, but then perhaps it would just be quicker to roll my own logic in this case.

























    • Topic Participants

    • bjorn