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