function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbrahamAbraham 

Working in mozilla but not in IE 6

All i have the following code working in mozilla but it gives me document.getEleme...... is null or not an object error.
 
My code is this
 
var formFields = ["Group_Name__c", "Other_Competitive_Distributer__c"];
 
and i am using this like this
 
for(var field in formFields) {
if(formFields[field] == "Group_Name__c") {
saveObject["Name"] = document.getElementById(formFields[field]).value;
}
if(formFields[field] == "Other_Competitive_Distributer__c")
{
break;
}
}
 
This code works fine in mozilla but in IE it fails.
 
Can someone help ?
 
Thanks in advance
 
jrotensteinjrotenstein
I'd say you've got in-page fields whose Name does not match the Salesforce field name (eg Custom Fields). If you get the Microsoft Script Editor going in IE, you should be able to debug it.
michaelforcemichaelforce
Make sure the page has fully loaded before allowing this script to run...  call it 'onload' of the body for instance.  Otherwise the Element may simply not have been rendered yet so it can't be 'gotten'.