Javascript issue with IE 5

I have a jsp where in some javascript is used to perform some validations. it works perfectly fine with IE 6. When the same application is run from a different machine that has IE 5, it gives me a javascript error:

[b][i]'undefined' isnull or not an object[/i][/b]

If any one had faced a similar situation, can you throw some light on what exactly could be the reason for this?

Thanks,

SirG

[483 byte] By [SirGenerala] at [2007-11-27 3:50:56]
# 1

I have run into that situation hundreds of times,and most likely, it is because you are calling an object (like a select list or Radio button group) with a standard that IE5 does not support.

Biggest example of this is the getElementById() tag ...

I you could post your code, I could try to get a better grasp of the reasoning behind it - otherwise, this is the best explanation I can offer.

Wasaabia at 2007-7-12 8:54:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

The following is my piece of code:

//myForm is my form object

//attKey its just a String "name"

function getAttribute(myForm , attKey){

for(i=0; myForm.attributes.length > i; i++){

var att = myForm .attributes[i];

alert(" fetched Attribute value = " + att.name);

// att.name fetches me the names of all the attributes in IE 6.0

// att.name the same fetches me 'undefined' always in IE 5.5

if (att.name == attKey){

alert("attkey:: "+ attKey + " att.value::"+att.name);

return att;

}

}

alert(" nothing matched so returning null");

}

Client doesn't want to upgrade to IE 6, as there are more than 350 brances all over and there are many prior applications that are still not compatible with IE 6.

SirGenerala at 2007-7-12 8:54:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I would change the name of the function if I were you, I'm pretty sure that's causing a problem.Elements already have a getAttribute() method and it's probably that which is causing the wierd behaviour.
nogoodatcodinga at 2007-7-12 8:54:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...