You need to sign in to do that
Don't have an account?
zabah
Illegal Form Object Names
Hey:
We've created some custom fields for our contacts and accounts and Salesforce gave these fields unique ID (e.g. 00N30000000d8Uu). Unfortunately, because this ID starts with a number, I'm unable to perform simple Javascript functions on the values of the form objects that result from these fields as Javascript considers illegal any form object whose name begins with a digit.
Has anyone gotten around this? Is there a way to request an ID that begins with a character of the alphabet?
Zabah!
Hi Zabah,
What if you prepend the fieldnames with an underscore or some other non-digit character? You could then get the object id by removing the prepended char when processing the form submission.
The answer is so simple, I'm embarrassed.
To get the value of a custom field in javascript, use the array of the form object:
strVariable = document.frmForm['00N30000000dIPr'].value;
I know it works in IE. Pretty sure it works in Netscape. I have not tested it in other browsers, though.