Basically, I have two yes and no radio buttons, and then two more input fields.
[LabelQuestion] [RadioYes][RadioNo] If yes, then... [TextField1] If no, then... [TextField2]
By default, I would like to have text fields 1 and 2 inactive / unable to enter data until the appropriate radio button is selected, and then this field will become available only for data input.
I am a complete newbie, but I think it is possible using CSS and / or JavaScript. Please keep in mind that I know JavaScript, but I can logically modify existing JS code.
My current code is as follows:
<div class='conlabel'>Have you started trading yet?</div> <table width="100"> <tr> <td><label> <input type="radio" name="example" value="Yes" id="example_0" required/> Yes</label></td> </tr> <tr> <td><label> <input type="radio" name="example" value="No" id="example_1" required/> No</label></td> </tr> </table> <li> <div class='conlabel'>If Yes, then:</div> <input type="text" name="field1" placeholder="" /> </li><br> <div class='conlabel'>If No, then:</div> <input type="text" name="field2" placeholder="" /> </li><br>
source share