Unhide text using a radio button

R

research_stuff

I have researched unhiding text using Javascript. I found examples
unhiding text boxes.
I need to unhide text when a radio button has been selected.

Can someone point me to an example?




Thanks in Advance.
 
B

Bart Van der Donck

research_stuff said:
I have researched unhiding text using Javascript.  I found examples
unhiding text boxes.
I need to unhide text when a radio button has been selected.

Can someone point me to an example?

<p>Do you like fruits ?</p>

<p>
<input type="radio" name="like" value="no"
onClick="document.getElementById('w').style.visibility='hidden'">
No
<br>
<input type="radio" name="like" value="yes" checked
onClick="document.getElementById('w').style.visibility='visible'">
Yes
</p>

<p id="w">
If yes, which: <input type="text" name="fruits" size="20">
</p>

Hope this helps,
 
R

research_stuff

<p>Do you like fruits ?</p>

<p>
 <input type="radio" name="like" value="no"
  onClick="document.getElementById('w').style.visibility='hidden'">
 No
 <br>
 <input type="radio" name="like" value="yes" checked
  onClick="document.getElementById('w').style.visibility='visible'">
 Yes
</p>

<p id="w">
 If yes, which: <input type="text" name="fruits" size="20">
</p>

Hope this helps,
 
R

research_stuff

<p>Do you like fruits ?</p>

<p>
 <input type="radio" name="like" value="no"
  onClick="document.getElementById('w').style.visibility='hidden'">
 No
 <br>
 <input type="radio" name="like" value="yes" checked
  onClick="document.getElementById('w').style.visibility='visible'">
 Yes
</p>

<p id="w">
 If yes, which: <input type="text" name="fruits" size="20">
</p>

Hope this helps,

Does anything need to be coded in the script language ?
 
T

Trevor Lawrence

<p>Do you like fruits ?</p>

<p>
<input type="radio" name="like" value="no"
onClick="document.getElementById('w').style.visibility='hidden'">
No
<br>
<input type="radio" name="like" value="yes" checked
onClick="document.getElementById('w').style.visibility='visible'">
Yes
</p>

<p id="w">
If yes, which: <input type="text" name="fruits" size="20">
</p>

Hope this helps,

Does anything need to be coded in the script language ?


Well, yes and no

What follows onclick= IS JavaScript, so you could regard it as JS embedded
in the HTML
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top