473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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 2053
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Perttu Pulkkinen | last post by:
What si the best and MOST BROWSERCOMPATIBLE way of making elements disabled for the user? Also considering different kind of elements: textfields, selects, radiobuttons and textareas. This is what...
7
by: murrayatuptowngallery | last post by:
Hello: I previously posted a question about how to do populate an html table dynamically with results from JavaScript Math and basic math. Dr Clue responded and this started the learning curve....
4
by: omidmottaghi | last post by:
I need to disable/enable form elements in my form. the code i was developed works fine in FF, but in IE, its behaviour is very strange!! in the form, we have a lot of checkboxes, all of them...
0
by: Tomas Vera | last post by:
Here's another goofy thing. I need to persist the state of items added dynamically to a Panel control between round-trips to the server. I have a web form that contains a TreeView and a...
2
by: HumptyDumpty | last post by:
Does anyone know if there is a problem with re-enabling the Screen Saver after it has been disabled programmatically. I am using the SystemParametersInfo function within User32.dll, and have...
7
by: John Meyer | last post by:
I have a program where I have to enable or disable a list box based upon a radio button. Is there an "enabled" property on select boxes?
2
by: dougawells | last post by:
Hi- I'm wanting to have a set of radio buttons disabled when a form is displayed, then if they check another specific radio button, those would become enabled. I've tried setting it via...
11
by: shankwheat | last post by:
I have a function which passes text from txtdebt to debtsbox which works fine. However, I want to add code which examines the value of debtsbox and if any of the values the user entered contain the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.