How to Disable any controls using Javascript?

 Posted by vishalneeraj-24503 on 12/24/2013 | Category: JavaScript Interview questions | Views: 938 | Points: 40
Answer:

With the help of disabled property,we can Disable any controls in Javascript.

In Dot net,we have Enabled property,but in Javascript it's just opposite.

For Example:-

<script type="text/javascript">

function disable_controls()
{
document.getElementById('<%=btn_read_cookies.ClientID%>').disabled = true;
}
</script>


<asp:Button ID="Button1" runat="server" Text="Click" OnClientClick="disable_controls(); return false;" />


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response