Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I Have written code

$('#<%=panel1.ClientID%>').attr('disabled', 'disabled');

this is working fine for Internet Explorer

But I need for Google Chrome


It is not working for Chrome

I need solution for this
Posted
Updated 6-Jun-13 3:17am
v3
Comments
Prasad Khandekar 6-Jun-13 9:18am    
Hello Vasantha,

Disabled attribute is applicable for form elements only. I am afraid it's not applicable for other elements.

Regards,

1 solution

XML
An asp:Panel just produces a div element. This isn't a form control, it's just there for structure.

To disable every input control inside of it, if you are using jQuery, try:

$("#<%=mypanel.ClientID%> input").attr("disabled", true);
Or plain ol' JavaScript:

var controls = document.getElementById("<%=mypanel.ClientID%>").getElementsByTagName("input");

for (var i = 0; i < controls.length; i++)
    controls[i].disabled = true;


--- refer: http://stackoverflow.com/questions/5088352/enable-disable-asppanel-and-all-its-control-using-javascript[^]
 
Share this answer
 
Comments
syna syna 7-Jun-13 2:33am    
will this solution work for all browsers?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900