![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
One question uses a group of four radio buttons and one of the options is "Other". A text field has been added next to the "Other" option so that users can provide additional information. What I am trying to do is get the text box to appear when the "Other" radio button is selected. |
#3
| |||
| |||
|
|
I have created a fairly simple form in Dreamweaver 4. One question uses a group of four radio buttons and one of the options is "Other". A text field has been added next to the "Other" option so that users can provide additional information. What I am trying to do is get the text box to appear when the "Other" radio button is selected. At the present, the text box is on screen permanently but I would like to hide this and have it visible only if the "Other" option is selected... Can anyone help? Thanks |
#4
| |||
| |||
|
|
I have created a fairly simple form in Dreamweaver 4. One question uses a group of four radio buttons and one of the options is "Other". A text field has been added next to the "Other" option so that users can provide additional information. What I am trying to do is get the text box to appear when the "Other" radio button is selected. At the present, the text box is on screen permanently but I would like to hide this and have it visible only if the "Other" option is selected... Can anyone help? Thanks |
#5
| |||
| |||
|
|
On Mon, 24 Nov 2003 14:59:23 +0000 (UTC), "Necroscope" webforumsuser (AT) macromedia (DOT) com wrote: One question uses a group of four radio buttons and one of the options is "Other". A text field has been added next to the "Other" option so that users can provide additional information. What I am trying to do is get the text box to appear when the "Other" radio button is selected. Place this in the <head> of the document: script type="text/javascript" function setVis(){ document.forms[0].txtOther.style.visibility=document.forms[0].rdoOther.checked?'visible':'hidden'; } /script This assumes that the ID for the radio button for "Other" is "rdoOther". Change that to whatever you actually put in the ID attribute. Give all the radio buttons the same NAME, but give each a unique ID. Then, for each of the radio buttons, add onClick="setVis()" for example: input name="radiobutton" type="radio" value="button2" id="button2" onClick="setVis()" Gary |
#6
| |||
| |||
|
|
I'm not sure that will work, Gary |
|
function setVis(element,radiogroup){ for(r=0;r<radiogroup.length;r++){ if(radiogroup[r].value=="other"){ element.style.display=radiogroup[r].checked?'block':'none'; return; } } } onclick="setVis(this,textfieldName)" |
![]() |
| Thread Tools | |
| Display Modes | |
| |