?
Solved

javascript help - works in ie, not in firefox

Posted on 2006-05-03
5
Medium Priority
?
159 Views
Last Modified: 2010-04-06
Hello
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;
    obj.disabled=endes;
   for (i = 0; i <  ln;  i++)
   {  
        obj.childNodes(i).childNodes(0).childNodes(0).disabled=endes;
        obj.childNodes(i).childNodes(1).childNodes(0).disabled=endes;      
   }  
   
}
    </script>

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

Expert Comment

by:KennyTM
ID: 16603559
Hi.

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

Expert Comment

by:walkerke
ID: 16614643
Javascript is supposed to be case sensitive but IE rarely follows the rules. Try getElementById().
0
 

Author Comment

by:bugnuker
ID: 16614992
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
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 16991500
PAQed with points refunded (120)

DarthMod
Community Support Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

621 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