Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Disable panels in C#.net using javascript only for mozilla

Hi all,
           I want to disable the panles in mozilla forefox. I write the following code. It is working fine with IE but it is not working with Firefox. Please help me.

document.getElementById('<%=Panel1.ClientID%>').disabled=true;
0
mannevenu
Asked:
mannevenu
1 Solution
 
Albert Van HalenCommented:
Panels will render themselves as divs.
You cannot disable or enable a div element.

If it's just about disabling input controls inside that div, you have to go trough each element inside the div and set the disabled attribute.
function disableDiv(divID) {
    var div = document.getElementById(divID)
    var fields = div.getElementsByTagName('input');
    for (var i=0; i < fields.length; i++)
        fields[i].disabled = true;
}
 
disableDiv('<%=Panel1.ClientID%>');
</script>

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now