Forum Moderators: open

Message Too Old, No Replies

Enabling textareas with checkboxes

         

WEcoyotesupergenius

10:29 am on Feb 9, 2005 (gmt 0)

10+ Year Member



I have a page with multiple forms and two textareas per form. When the page loads I want all the teaxtareas to be disabled and I want to be able to enabled each one individually with a checkbox right next to it. Can someone show me how? Thanks.

Here's the textarea:


<textarea rows="6" cols="27" name="product[]">

orion_rus

10:41 am on Feb 9, 2005 (gmt 0)

10+ Year Member



i think it should work:

<div>
<div>
<input type="checkbox" onclick=this.parentNode.parentNode.lastChild.style.display='block' > Text <br />
<div>
<div style="display:none">
<textarea rows="6" cols="27" name="product[]">
</textarea>
</div>
</div>

WEcoyotesupergenius

4:11 pm on Feb 9, 2005 (gmt 0)

10+ Year Member



Thanks Orion. One question though. I have my forms built in tables rather than div blocks (much cleaner) and will the
 style="display:none" 
work in a table? I won't be at my PC until later so I can't test it right now.