I have a form with two radio buttons, line 1 and 2, and a text box on the third line
<input type="radio" name="mybox1" value="1" checked="checked" />No
<input type="radio" name="mybox2" value="2" />Yes
<input type="text" size="8" name="mytext" />
The requirement is:
If "No" is selected, the textbox must be empty on submitting the form.
If "Yes" is selected, the textbox on line 3 must not be empty on submitting the form.
So I cannot add the attribute 'required' in the third line, instead
I have to control it dynamically depending on the radio button selection.
How can I accomplish this?