473,769 Members | 5,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="docume nt.getElementBy Id('metoo').dis abled = '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 2079
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="docume nt.getElementBy Id('metoo').dis abled = '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
1485
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 I have had, its quite okay in IE but not good enough for Netscape. - I remember there was problem with setAttribute(wich would looked natural pair to removeAttribute) so I used disabled = "disabled" instead. function bluron(form,ele)
7
2576
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. I think the terminology for what I want to do is pass variables to the <td> 'workspace' (half this statement might make sense). The problem I am having is being overwhelmed with understanding the context of each new statement, syntax etc.
4
2267
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 named like "xyz_np". in front of each checkbox, we have some fields, named "xyz" this is my JS code. after clicking on checkboxes:
0
1384
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 DropDownList My web form reads the value of the drop down list, runs a query against a database, then presents the results of the query to the user with a TreeView (IE WebControls version). When the user checks an item's checkbox, the item is
2
2841
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 been successful in disabling the Screen Saver, but it does not work for re-enabling. The only way I can re-activate it is to re-apply the settings through the Display properties in the Control Panel. Sample lines of code, in simplest form:
7
2236
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
6317
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 window.document.formname.radiogroup.disabled="true"; (or false) - but that doesn't seem to work. I've seen this done with text boxes, but not with radio buttons. Can anyone give any help? Thanks
11
2241
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 string "d" then I want to emable rblDebts which is disabled when the page loads. This part is not working (no errors) and I'm not sure why. Thanks. <script type="text/javascript" language="JavaScript"> <!-- Begin oldvalue = "";
0
9583
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10039
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.