Tips for Enabling/Disabling ASP.NET Checkbox using Javascript

When we use a ASP.NET checkbox and by default keep it disabled. If you see the view we will notice as seen below

<
span disabled='disabled'
>
<
input type='checkbox' disabled='disabled'
>

Now if we say document.getElementById("chktest").disabled = false; . This will not work.

The workaround is

document.getElementById("chktest").disabled = false;
document.getElementById("chktest").parentNode.disabled = false;


Cheers!!!

Comments

Popular posts from this blog

Jesus - God Thinks of you.

ASP.NET 4.0 Feature - URL Routing

Tips on JQuery Intellisense in VS 2008