Skip to main content
Hello,

 

My company is launching a new website and it is starting to impact the way we use Salesforce.

 

Currently, on our web to lead form on our website, the first name and last name are seperate fields and then map correctly to sales force.

 

Our new developer's form combines the first and last name. I was wondering if there was a custom apex code or a way to parse the name into "first name" and "last name" to have them go into their respected fields. If not, is there a work around to get first name and last name into the correct spots?

 

Thanks,

 

Erica
2 answers
  1. Feb 4, 2014, 7:41 PM
    I really don't think there is a need to do some changes on the Salesforce side. If your Web Developer can do some JavaScript, then you can easily do the splitting of the Name at the Website end then map them to the correct fields on the Web-To-Lead form on the Web Page.

     

    For eg: this HTML that gets generated in Salesforce - 

     

    <label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

     

    <label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>

     

    can be converted to Hidden fields like as below:

     

    <input  id ="first_name" name ="first_name" type ="hidden" />

     

    <input  id ="last_name" name ="last_name" type ="hidden" />

     

    Then your Developer can do a little JS to do the splitting of the actual name and then populate them to these hidden fields. So when the User clicks the Submit, the fields will be mapped appropriately and would reach Salesforce hassle-free.
0/9000