SOLVED

Issues with splitting full name

Go to solution
Highlighted
Anonymous
Not applicable

Issues with splitting full name

I am using the technique from this blog post: http://developers.marketo.com/blog/add-a-full-name-field-to-a-marketo-form/​ to add a full name field to my forms and split the entry into the first and last name fields in marketo.

This seems to be working some of the time, but only about half. Many leads are coming through with full name field filled out, but nothing in first and last name. There seems to be no consistency with browser or page, so I'm not sure what's going wrong. There are no console errors on pages which use this form either. Does anyone have an idea of what might be going wrong with this javascript? I know I can't expect it to work 100% of the time, but it's failing often enough that I suspect something is wrong.

Here is a link to a page that uses the form: http://www.outboundengine.com/blog/

It's the form in the right hand column under "Want a Sample Campaign For Your Business?".  Once you choose an industry from the first dropdown, the full name field appears.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: Issues with splitting full name

The fundamental design of the JS snippet means that it misses form autofill events (where the user's browser fills in the form automatically based on saved information, like you often see on ecommerce pages). This is likely the precise cause of your problem.

To be more technical, the script only waits an ​input​ event on the fullName field, erroneously assuming that will catch any time the field is populated. But browser-based autofill does not fire an input event on textboxes in all browsers, because it is not considered human interaction.

No idea why the script even tries to fire on every input. ​It should just wait for the ​onSubmit ​event.  I could rewrite just the part that is broken, but I don't want you to hold the rest of the script against me because that isn't the way I'd do the rest of it, either. 

View solution in original post

8 REPLIES 8
Highlighted
Level 10 - Community Moderator

Re: Issues with splitting full name

What's an example of a fullName that is posted without a FirstName and LastName in the same form submission (you can look at the Filled Out Form activity and see the exact payload that is posted)?

Highlighted
Level 10 - Community Moderator

Re: Issues with splitting full name

The fundamental design of the JS snippet means that it misses form autofill events (where the user's browser fills in the form automatically based on saved information, like you often see on ecommerce pages). This is likely the precise cause of your problem.

To be more technical, the script only waits an ​input​ event on the fullName field, erroneously assuming that will catch any time the field is populated. But browser-based autofill does not fire an input event on textboxes in all browsers, because it is not considered human interaction.

No idea why the script even tries to fire on every input. ​It should just wait for the ​onSubmit ​event.  I could rewrite just the part that is broken, but I don't want you to hold the rest of the script against me because that isn't the way I'd do the rest of it, either. 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Issues with splitting full name

I'm not sure I am advanced enough with javascript to do this myself, so any help would be greatly appreciated. If you know a better way, I am more than willing to try it.

Highlighted
Level 10 - Community Moderator

Re: Issues with splitting full name

If you follow me back I can DM you the fixed code.  I honestly don't want to be publicly associated with the rest of it.

Highlighted
Anonymous
Not applicable

Re: Issues with splitting full name

I just followed you!

Highlighted
Level 4

Re: Issues with splitting full name

Hi there,

I would also like to use a Full Name field, and let First and Last name be populated in the background. But what do you do if a Full Name consists out of more than 2 words?

We have a very international database, with names in a lot of different languages. If a full name = Jan van den Berg, how can you automate populating first and last name? Here we have a first name with 1 word, and a last name that consists out of 3 words.

Other example: full name =  Sue Ann Smith. Now I have a first name with 2 words, and a last name with 1 word.

I wouldn't want our first and last name fields to be populated wrongly.

Any thoughts?

Thanks!

Tom

Highlighted
Level 10 - Community Moderator

Re: Issues with splitting full name

You've astutely pointed out why such techniques are doomed to failure, not only in international but even in US-only contexts. This is why I said I wanted no connection to the "working" code! ("Working" in the sense that it always passes *something* for FN and LN, which Erin noted doesn't happen now.)

Just as bad IMO is the referenced code's attempt to "correct" capitalization, which can result in insulting those, like your Jan van den Berg, who use lower-case nobiliary particles (while others using the same spelling may capitalize those same words). This is a pet peeve of mine as you can see on some other threads!

Unless paired with a public records search or some human verification step, this splitting/autocorrect stuff can't be used in what I would consider a reputation-safe way.

That said, if you only ever *display* the entire Full Name to the lead (without any changes) then it'll make your forms friendlier.

Highlighted
Level 4

Re: Issues with splitting full name

Thanks for the update Sanford.

It's indeed unfortunate that a human verification step is still needed.

As we like to keep things personal and slightly informal in our emails, I'm afraid I need to stick with a separate first and last name field.

Thanks,

Tom