473,499 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

disable single radio button in RadioButtonList

How can I disable a single radio button in a RadioButtonList? I tried doing this:

radioList.Items[1].Attributes.Add("disabled", "true");
radioList.Items[5].Attributes.Add("disabled", "true");

but it didn't output the correct HTML (no disabled attribute).

Thanks,
Dave
Nov 17 '05 #1
2 6533
Wild guess here..How about

radioList.Items[1].Attributes.Add("enabled", "false");
radioList.Items[5].Attributes.Add("enabled", "false");

HTH
Brian W

"headware" <he******@aol.com> wrote in message
news:e3**************************@posting.google.c om...
How can I disable a single radio button in a RadioButtonList? I tried doing this:
radioList.Items[1].Attributes.Add("disabled", "true");
radioList.Items[5].Attributes.Add("disabled", "true");

but it didn't output the correct HTML (no disabled attribute).

Thanks,
Dave

Nov 17 '05 #2
I was trying to get the following HTML to be output by APS.NET

<FORM ACTION="whatever">
Here are some radio buttons<P>
<INPUT TYPE=RADIO NAME="btn1" VALUE="S" DISABLED>button 1<BR>
<INPUT TYPE=RADIO NAME="btn2" VALUE="M">button 2<BR>
<INPUT TYPE=RADIO NAME="btn2" VALUE="L">button 3<P>
<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>

It's my understanding that "enabled" is not an attribute that the
<input> tag understands. I guess my point is that APS.NET isn't
outputing anything, whether it's valid HTML or not. No disabled=true
or even enabled=false. What am I doing wrong?
"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message news:<#W**************@TK2MSFTNGP11.phx.gbl>...
Wild guess here..How about

radioList.Items[1].Attributes.Add("enabled", "false");
radioList.Items[5].Attributes.Add("enabled", "false");

HTH
Brian W

"headware" <he******@aol.com> wrote in message
news:e3**************************@posting.google.c om...
How can I disable a single radio button in a RadioButtonList? I tried

doing this:

radioList.Items[1].Attributes.Add("disabled", "true");
radioList.Items[5].Attributes.Add("disabled", "true");

but it didn't output the correct HTML (no disabled attribute).

Thanks,
Dave

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8725
by: Michael Albanese | last post by:
I am developing an application to handle my compay's OSHA reporting requirements. Some of the input criteria are technical and narowly defined, so I was trying to prvide what i call "Context...
1
9966
by: John Criswell | last post by:
I have created a radio button list programmatically. C# SqlConnection conn = new SqlConnection("data source=localhost; integrated security=true; initial catalog=pubs"); SqlCommand cmdAuthors =...
1
5049
by: | last post by:
Is it possible to disable just a certain radio button in a RadioButtonList control? I've researched this issue for a while now and haven't come up with anything. Thanks, Dave
0
2191
by: Ryan Taylor | last post by:
Hello. I am having another issue. I need to execute some JavaScript whenever a radio button is clicked. I am currently using a RadioButtonList control to generate the radio buttons because of...
3
2691
by: pierre.basson | last post by:
Hi, I have a DataList with an Item Template that contains an image and three radio buttons, which are used to indicate the image's status. How can I set the appropriate radio button to checked,...
4
2941
by: enahar | last post by:
I have created RadioButtonList1 having 2 radio buttons in the list.How to make enable/disable only 1 radio button in the RadioButtonlist. Thanks for your help. Regards.
6
2304
by: Mike | last post by:
I have a form that contains 240 "products". Each Product has a TR. Each TR contains a Yes and No radio button and a Product-Qty text input. A situation exists where I have to go through all the...
1
1897
by: sama via DotNetMonster.com | last post by:
Hi , I am using a radioButtonList insisde a div. Now, on clcick of a button i want to disable the radiobuttonList. When i say document.getElementById('divsama').disabled=true; it works in IE but...
0
1571
by: dancer | last post by:
Can somebody tell me why my RequiredFieldValidator works for the TEXT BOX, (location) but does NOT work for the RADIO BUTTON (EmpTrain)? <%@ Page Language="VB" ClientTarget="downlevel" %> ...
0
7128
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
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7215
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...
1
6892
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
7385
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
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
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 ...
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.