You need to sign in to do that
Don't have an account?

Javascript Error with Web-to-lead and custom fields
Hello,
Salesforce.com custom fields have preassigned field names that start with zeroes "00N000000etc". (Doesn't conform to W3C standards: http://www.w3.org/TR/html401/types.html#type-name)
For some reason, client-side JavaScript raises an error whenever I try to access a custom field. Using eval( ) doesn't work either. If the first character of the field name starts with a character, it all works fine. Any workarounds?
// these don't work
eval("alert(myForm.00N00000006ozIN.value)");
alert(myForm.00N00000006ozIN.value);
// these work
eval("alert(myForm.x00N00000006ozIN.value)");
alert(myForm.x00N00000006ozIN.value);
Thanks so much.
-Zach.
Message Edited by zekay2000 on 07-30-2004 04:27 PM
Hi zach,
You are correct in your assertion that the field names that start with a numeric don't conform. That is why we modified the names back in 2.0 to have a cf_ prepended to them. 2.0 was the last version of xml-rpc and is the process of being de-supported. In SOAP sforce 2.5 and above, custom fields have friendly, user assigned names.
Please consider moving to the SOAP interface if you are using xml-rpc, or the 2.5 API if you are using SOAP and the 2.0 API.
Hey Dave,
Thanks for your reply. I'm going to expose myself as a total newbie and ask a most likely silly question: In salesforce.com, when I define a custom field for a lead and then generate the html for the web-to-lead form the field names are assigned automatically, without the "cf_" prepend. Is there a setting I need to change to take care of this?
Thanks so much!
-Zach.
Hi zach,
This looks like a bug, smells like a bug, walks like a bug.......
I think you've uncovered a bug!
I will file it as such with our dev team. Hopefully we'll get a fix out before long (a week or so).
Hey Dave,
Any ETA on when this will be fixed. Client wants to know.
Thanks!
-Zach.
alert(myForm.elements['00N00000006ozIN'].value);
onthebeach
Cheers
Dave.