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

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
 
M

Madhusudhan

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
 
X

xazos79

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.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top