Solved

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

Posted on 2009-04-01
1
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…
Suggested Courses

623 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