Form!

liunx

Guest
How can you keep a textbox hidden until they click a required checkbox saying they agree. I need something like that... Thanks, or even better, a radio button! When a radio button is clicked then a textbox shows up next to it.<br />
<br />
Jonathan<!--content--><form action="" name="myForm"><br />
<input type="radio" name="myR" value="one" onClick="this.form.t1.style.visibility='visible';"> One<br />
<input type="radio" name="myR" value="two" onClick="this.form.t2.style.visibility='visible';"> Two<br />
<input type="radio" name="myR" value="three" onClick="this.form.t3.style.visibility='visible';"> Three<br />
<br><br><br />
<input type="text" name="t1" style="visibility:hidden;"><br><br />
<input type="text" name="t2" style="visibility:hidden;"><br><br />
<input type="text" name="t3" style="visibility:hidden;"><br />
</form><br />
<br />
<br />
Jona<!--content-->It didn't work... It just shows 3 textboxes and 3 radio boxes... help..?<br />
<br />
This is a <hassle>forever</hassle><!--content-->I've edited my post.<br />
<br />
Jona<!--content-->Thank you, but is there a way to make it like disabled when it is not clicked, just take one checkbox for an example... clicked a textbox opens up, but unclick box goes away<!--content-->I've done this before with SELECT boxes. It should be easy enough for you to figure out how to make them work with radio buttons: <!-- m --><a class="postlink" href="http://jona.t35.com/experiments/show_hide_layers.html">http://jona.t35.com/experiments/show_hide_layers.html</a><!-- m --> <br />
<br />
Jona<!--content-->what about checkboxes?<!--content-->This should do the trick:<br />
<br />
<br />
<form action="" name="myForm"> <br />
<input type="checkbox" name="myR" value="one" onClick="if(this.form.t1.style.visibility=='visible'){this.form.t1.style.visibility='hidden';}else{this.form. t1.style.visibility='visible';}"> One <br />
<input type="checkbox" name="myR" value="two" onClick="if(this.form.t2.style.visibility=='visible'){this.form.t2.style.visibility='hidden';}else{this.form. t2.style.visibility='visible';}"> Two <br />
<input type="checkbox" name="myR" value="three" onClick="if(this.form.t3.style.visibility=='visible'){this.form.t3.style.visibility='hidden';}else{this.form. t3.style.visibility='visible';}"> Three <br />
<br><br> <br />
<input type="text" name="t1" style="visibility:hidden;"><br> <br />
<input type="text" name="t2" style="visibility:hidden;"><br> <br />
<input type="text" name="t3" style="visibility:hidden;"> <br />
</form><br />
<br />
<br />
Jona<!--content-->nothing shows up<!--content-->Check the code again--you have to check a box. I changed it from radio buttons to checkboxes.<br />
<br />
Jona<!--content-->Thank you very much<!--content-->Welcome you are.<br />
<br />
Jona<!--content-->
 
Back
Top