We help IT Professionals succeed at work.

Javascript -enable textarea with checkboxes

roscoeh23
roscoeh23 asked
on
476 Views
Last Modified: 2010-08-05
I want 4 textareas and 4 checkboxes that are initially disabled and then enable if the checkbox beside it is ticked. So If I want to enter data into textarea 3 I check checkbox 3 before I am allowed to

It doesn't have to return to the disabled state if it is then unchecked.

Ta,

Ross
Comment
Watch Question

TimCotteeApplications and Integrations Consultan

Commented:
Hi roscoeh23,

<textarea id="TA1" disabled /><input type=checkbox onclick="document.getElementById('TA1').disabled=false;" value="Enable TextArea 1" /><br />
<textarea id="TA2" disabled /><input type=checkbox onclick="document.getElementById('TA2').disabled=false;" value="Enable TextArea 2" /><br />
<textarea id="TA3" disabled /><input type=checkbox onclick="document.getElementById('TA3').disabled=false;" value="Enable TextArea 3" /><br />
<textarea id="TA4" disabled /><input type=checkbox onclick="document.getElementById('TA4').disabled=false;" value="Enable TextArea 4" /><br />

Tim Cottee
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
TimCotte. I like the look of your idea. Is there anerrror in the code?


R.

Commented:
Tim's code should also work but missed the </textarea>
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.