drpudding
drpudding

Reputation: 159

QuickForm validation of one field based on another

I am trying to validate a QuickForm (v1 not v2) form where there are three fields where the second two fields only needs to be completed if the first field is completed. Specifically, the first field is a radio button input like so:

<input type="radio" value="" name="r[5][session]">
<input type="radio" value="1" name="r[5][session]">
<input type="radio" value="2" name="r[5][session]">

If someone selects value 1 or 2, then they must complete these two corresponding fields:

<select name="r[5][transp_to]"></select>
<select name="r[5][transp_from]"></select>

I can't seem to find a way to do this in the documentation.

Upvotes: 1

Views: 55

Answers (0)

Related Questions