Solved

disable controls in mozilla firefox using javascript

Posted on 2009-04-01
1
624 Views
Last Modified: 2012-06-21


I used this code but i was unable to disabled the controls in mozilla firefox.
<script type="text/javascript">
function DisableControls(el)
{
    try
    {
        el.disabled = true;
    }
    catch(E){}
    if (el.childNodes && el.childNodes.length > 0) {
        for (var x = 0; x < el.childNodes.length; x++) {
            DisableControls(el.childNodes[x]);
            }
    }
}
DisableControls(document.getElementById("<%=pnlQuestions.ClientID %>"));
</script>

Open in new window

0
Comment
Question by:mannevenu
1 Comment
 
LVL 30

Accepted Solution

by:
third earned 500 total points
ID: 24037555
the code works fine for me both IE and Firefox. make sure you invoke the function after the controls have loaded.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

820 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