Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > disable single radio button in RadioButtonList

Reply
Thread Tools

disable single radio button in RadioButtonList

 
 
headware
Guest
Posts: n/a
 
      11-12-2003
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
 
Reply With Quote
 
 
 
 
Brian W
Guest
Posts: n/a
 
      11-12-2003
Wild guess here..How about

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

HTH
Brian W



"headware" <> wrote in message
news: 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



 
Reply With Quote
 
 
 
 
headware
Guest
Posts: n/a
 
      11-13-2003
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:<#>...
> Wild guess here..How about
>
> radioList.Items[1].Attributes.Add("enabled", "false");
> radioList.Items[5].Attributes.Add("enabled", "false");
>
> HTH
> Brian W
>
>
>
> "headware" <> wrote in message
> news: 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

 
Reply With Quote
 
Tim Tim is offline
Junior Member
Join Date: Dec 2007
Posts: 4
 
      09-16-2010
Don't try setting disabled to false. Set disabled to disabled. Sounds strange, but that's how it works.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add onclick javascript code to each radio button in a RadioButtonList control Ryan Taylor ASP .Net 2 03-20-2008 06:12 PM
grabbing the value of a radio button (not an asp:radiobuttonlist) darrel ASP .Net 2 03-24-2005 11:40 PM
adding attributes to radio button list <asp:radiobuttonlist .../> don't work? psb ASP .Net 2 09-22-2004 03:53 PM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM
disable radio button in RadioButtonList ASP .Net 1 11-18-2003 12:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57