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

Unable to re-enable a radio button if disabled server-side

P: n/a
Hi All,

I've come across the problem of not being able to re-enable a radio
button with javascript if its initial state has been disabled in the
Page_Load() method of the code behind.

Might i add that it behaves fine in Firefox, but IE is unable to
re-enable the radio button. IE is fine if the radio button starts in an
enabled state.

Version of IE i'm using is 6, and i have also tried with IE7 and got
the same result.

Is this a bug specific to IE ?

Any help would be appreciated, thanks.
- Sam

Mar 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
xazos79 wrote:
Hi All,

I've come across the problem of not being able to re-enable a radio
button with javascript if its initial state has been disabled in the
Page_Load() method of the code behind.

Might i add that it behaves fine in Firefox, but IE is unable to
re-enable the radio button. IE is fine if the radio button starts in an
enabled state.

Version of IE i'm using is 6, and i have also tried with IE7 and got
the same result.

Is this a bug specific to IE ?

Any help would be appreciated, thanks.
- Sam

========================

Hi There

<script>
function enable()
{
var controls = document.getElementsByTagName("input");
NumElements = controls.length;

for (i=0;i<NumElements;i++)
{
if(controls[i].name=="rdEnable")
{
controls[i].setAttribute("disabled" , false);
ParentSpanControl = controls[i].parentElement;
ParentSpanControl.setAttribute("disabled" , false); break;
}
}

return false;
}
</script>

Explanation:
============
A DotNet Radio Button Control will result in creation of the following
three controls

1.Span Control
2.Input Type=Radio
3.Label

So using javascript , do identify all the controls that radio button is
rendered to and set their disabled propery to false;

Please find the above code which does the same
Mar 1 '06 #2

P: n/a
Cheers for the reply. I might give your suggestion a try. As a work
around i just used some javascript and registerd it in the codebehind
as a startup script to perform the enabling/disabling. Seems to work
fine.

Mar 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.