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

  • Thread starter Thread starter xazos79
  • Start date Start date
X

xazos79

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
 
xazos79 said:
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.name=="rdEnable")
{
controls.setAttribute("disabled" , false);
ParentSpanControl = controls.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
 
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.
 
Back
Top