By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

Dynamic enabling/disabling of form elements?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.