There 2 radio buttons.when a radio is clicked textbox should appear,when another radio clicked the existing textbox should disappear and new textbox should be enabled.
To invoke a textbox when radio button clicked
Collapse
X
-
Use onclick event of the radio buttons to display and hide the textareas accordingly. style.display can be useful.Comment
-
onclick of the radio call a function like this
[HTML]
<input type="radio" id="myRadio" name="myRadio" onclick="enable _disable();"\>
<input type="text" id="myRadioText one" name="myRadioTe xt" class="optional " style="display: none"/>
<input type="text" id="myRadioText two" name="myRadioTe xt" class="optional " style="display: none"/>[/HTML]
similiarly for the second radio do viceversaCode:function enable_disable() { var textFieldone=document.getElementById('myRadioTextone'); var textFieldtwo=document.getElementById('myRadioTexttwo'); textFieldone.style.display='block'; textFieldtwo.style.display='none'; }Comment
Comment