Solved

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

Posted on 2009-04-01
1
271 Views
Last Modified: 2012-05-06
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
Comment
Question by:mannevenu
1 Comment
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 total points
ID: 24038037
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JavaScript export function not working in IE 15 38
form button worked now it doesnt anymore 9 42
how would you interpret lines 3 31
replace all occurrences within a string 8 19
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now