469,610 Members | 2,007 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

Dynamic enabling/disabling of form elements?

I'm currently working on a form for my site and would like to do something
that I've seen many times on other sites. I would like to make a particular
form element enabled or disabled depending on whether another requisite form
radio button is checked.

I tried this:

<input type="radio" name="yesorno" id="yes"
onClick="document.getElementById('metoo').disabled = 'false';">
<br>
<input type="checkbox" id="metoo" disabled="true">
<br>
<br>
<input type="radio" name="yesorno" id="no">
but it doesn't work--I can't figure out why. Can someone help? Thanks.
Jul 20 '05 #1
1 1972
Ahh, nevermind I figured it out. You don't need the quotes around the false
because it isn't a string.


"TheKeith" <no@spam.com> wrote in message
news:x-********************@giganews.com...
I'm currently working on a form for my site and would like to do something
that I've seen many times on other sites. I would like to make a particular form element enabled or disabled depending on whether another requisite form radio button is checked.

I tried this:

<input type="radio" name="yesorno" id="yes"
onClick="document.getElementById('metoo').disabled = 'false';">
<br>
<input type="checkbox" id="metoo" disabled="true">
<br>
<br>
<input type="radio" name="yesorno" id="no">
but it doesn't work--I can't figure out why. Can someone help? Thanks.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Perttu Pulkkinen | last post: by
4 posts views Thread by omidmottaghi | last post: by
reply views Thread by Tomas Vera | last post: by
2 posts views Thread by HumptyDumpty | last post: by
7 posts views Thread by John Meyer | last post: by
2 posts views Thread by dougawells | last post: by
11 posts views Thread by shankwheat | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.