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

disable single radio button in RadioButtonList

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


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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.