javascript help - works in ie, not in firefox

Posted on 2006-05-03
Last Modified: 2010-04-06
I have some javascript here that works great in IE.
IT diables the controls when clicking on a checkbox
the checkbox has the onlcick=document.getelementbyid(id)

here is the javascript code that works in IE:
 <script language="javascript" type="text/javascript">
function DisableControls(obj)
    ln =  obj.childNodes.length-1;    
    endes = !obj.disabled;
   for (i = 0; i <  ln;  i++)

I need help making this work in firefox, and hopefully the other main ones too (safari, etc..)
Question by:bugnuker
    LVL 8

    Expert Comment


    Try using [i], [0], [1], etc. instead of (i), (0) and (1) inside the for() loop.
    LVL 11

    Expert Comment

    Javascript is supposed to be case sensitive but IE rarely follows the rules. Try getElementById().

    Author Comment

    thanks everyone for your help
    i had the case right, i just did not copy/paste that part of the code
    the [i] and stuff did nothing.
    i ended up just disabling all the controls manualy instead of trying to disable the things inside of a span.
    ADMINS - please set to PAQ
    LVL 1

    Accepted Solution

    PAQed with points refunded (120)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    761 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

    7 Experts available now in Live!

    Get 1:1 Help Now