I have this problem, document.all is undefined in Firefox. But when I tried using IE it works fine. I tried replacing document.all to document.getElementById but another problem occur, cltPlusMinus is undefined. Below is the function.
function toggleClient(cltID)
{
var cltProjects = document.all["clt" + cltID + "Project"];
var undef;
var cltPlusMinus = document.all["plusMinus" + cltID];
if (cltPlusMinus.src.indexOf("plus.gif") != -1)
cltPlusMinus.src = cltPlusMinus.src.replace("plus.gif", "minus.gif");
else
cltPlusMinus.src = cltPlusMinus.src.replace("minus.gif", "plus.gif");
if (cltProjects != undef)
{
if (cltProjects.length == undef)
{
toggleElement(cltProjects);
}
else if (cltProjects.length > 0)
{
for (var i = 0; i < cltProjects.length; i++)
{
toggleElement(cltProjects[i]);
}
}
}
document.all is IE-only code, so you should avoid it like a plague and use document.getElementById, which is supported by all browsers.
I don’t see anything with id “cltPlusMinus” in your code, so it is undefined. Probably you forgot to post that part of code. Make sure you do have element with that id somewhere in your code and it will work fine.
No, that’s all the code, I posted everything there. The “cltPlusMinus” is where the symbol “+” and symbol “-”. When you click “+” it shows all the client, “-” it toggles OFF.
No that isn’t the generated HTML - that is some server side language that will be used to generate the HTML as it is filled with <% %> references that will not be there in the generated HTML.