Radio buttons, javascript and codebehinds

J

JasonG

Hi All,

I have a radio button group that needs to be enabled or disabled by
checking a check box. That is the easy part. It gets difficult in
that the radio buttons are initially set to an enabled or disabled
state via the codebehind when the page first loads.

The problem I am having is that the HTML generated on page load has
span tags wrapped around all the input tags. Then the input tags
themselves are set to disabled.

I would imagine than I need to somehow set the disabled attribute in
the span tags to false and then do the same thing for the radio button
group, but I have no idea how to do this.

Has anyone ran across this before? Any ideas?
thanks,
JasonG
 
J

Jay

Hi Jason,

The answer that I am supplying is not the complete answer you are looking
for but it should get you started.
e.Item.Attributes.Add("disabled", "")

Adding this line to the appropriate event will add disabled tags to your
controls. If you can do this conditionally based on only your radio
buttons, your desired result will be achieved.

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top