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

x
?
Solved

disable controls in mozilla firefox using javascript

Posted on 2009-04-01
1
Medium Priority
?
633 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 2000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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

876 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