Add a Full Name Field to a Marketo Form

December 16, 2014 | by

We know that shorter web forms improve conversion rates. The Javascript code sample below allows you to make your forms even shorter by merging the First and Last Name fields into one Full Name field.

When visitors are typing in their full name, the script will automatically break the text into first and last name fields. For known visitors the script will join the first and last names, and then copy them to the new field so they won’t have to fill the field again. Here is how to set this up.

Step One
Create a new custom field in Marketo called Full Name. No need to create it in your CRM platform, as the script will only use this field to display the full name.

Step Two
Add this field to all your web forms. Set your first name and last name fields as hidden. In the Javascript, change the “splitFullName” configuration to contain the 3 field names.

Note: Please make sure these names do not appear anywhere else on the page.

Step Three
Insert the Javascript into all your landing pages at the bottom of the code, before the tag.

Note: This code works only with Marketo Forms 2.0.

Here are a few examples of the expected results:
Screen Shot 2014-12-16 at 3.01.47 PM