Click to See Complete Forum and Search --> : Checkbox question


timster69
12-05-2002, 03:08 PM
I have an area on my form that only want displayed if the checkbox above it is checked. So, if a someone is filling out the form and clicks the YES checkbox, another text field opens up below it for them to add additional information. I've seen this done with VBSCRIPT, but I thought it would be possible with JavaScript, right? Something like:

<input type="checkbox" name="yes" ID=Check1 value="1" onClick="dosomething">

And then have the additional info below. Any help would appreciated.

timster69
12-06-2002, 07:52 AM
That will work for my purposes. If I play around with this code, can I make this work between <table> tags? So I can have an entire section of table appear and disappear onClick? I actually need it to work between <tr> tags. Thanks.

Zach Elfers
12-06-2002, 07:09 PM
Yeah, you could use that script for tables too, although you might need to tweak it though.

Zach Elfers
12-06-2002, 07:11 PM
Originally posted by Dave Clark
<div id="additionalDiv" style="visibility:hidden;">
<input type="text" name="additionalInput" ... disabled>
</div>


visibility:hidden; will leave a space where that element should be. The space will be the size of the element. To have the element completely hidden do display:none;

timster69
12-09-2002, 09:38 AM
thanks for all the info. Works just as I needed.