SOLVED

Implementing form data validation for email?

Go to solution
Andy_Varshneya1
Level 9

Hi,

I'm facing a slight dilemma and could use everyone's collective brain power to work through the issue in case someone has addressed it already.

My demand gen team is trying to make a case for why we need email validation on our forms so that leads cannot fill out forms with their personal email addresses (gmail, yahoo, hotmail, etc). This could be an easy problem to solve with a script or a service like BriteVerify or Etumos, except for the fact that we didn't do this before so leads who may have filled out forms and be directed to forms with their personal email address will no longer be able to fill out those forms because of the script. This would essentially lead to us creating duplicates in our database, one for andy@gmail.com and one for andy@company.com, not to mention the terrible UX.

One option I'm considering is having a hidden checkbox to see if it's an existing lead in the database already and based on that, enable or disable the script. This would probably work somewhat consistently but not be bulletproof.

If someone else has navigated this project before, how did you handle it? Is it still possible to launch the project without creating an operational nightmare? I want to make sure I've considered all options before I go back to the team with an answer.

Thanks in advance,

Andy

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Great question and @Edward Unthank​ and I have talked about adding preliminary verification against a Marketo instance to Etumos Verify. The reasons it hasn't been rolled out are, to be totally frank, Edward's concern about demand (solved!) and my by-now-predictable concern about API calls and service resilience. If it's key to your application, I see no reason to not add it. 

As for doing this all client-side: if you're using Marketo-hosted LPs, I probably could help you make the "existing lead bypass" pretty close to bulletproof.

View solution in original post

13 REPLIES 13
Anonymous
Not applicable

We use a custom javacript as hidden HTML in the form itself. It's actually quite easy. Here's what we throw in:

Business domain validation code for Forms 2.0

Note: Remember to change the highlighted text with form-specific information. You can put whatever "public" email domains you wish directly into the list of invalid domains.

<script type="text/javascript" src="http://info.ascentis.com/js/public/jquery-latest.min.js" language="Javascript"></script>

<script src="//app-abj.marketo.com/js/forms2/js/forms2.js"></script>

<form id="mktoForm_355"></form>

<script>

  // set no conflict mode for jquery

  var $jQ = jQuery.noConflict();

    //edit this list with the domains you want to block

  var invalidDomains = ["@gmail.com","@yahoo.com","@live.com","@hotmail.com","@aol.com","@comcast.net","@earthlink.net","@msn.com","@sbcglobal.net","@bellsouth.net","@bellsouth.com","verizon.net","@me.com","@icloud.com"];

function isEmailGood() {

    for(i=0; i < invalidDomains.length; i++) {

      if ( $jQ("#Email[value*=" + invalidDomains[i] + "]").length > 0) {

          return false;

      }

    }

return true;

}

MktoForms2.loadForm("//app-abj.marketo.com", "your marketo user ID", 355, function(form){

  1. form.onSubmit(function() {

if(!isEmailGood()) {

                // just in case this doesn't work, change "form.showErrorMessage" to "alert" form.showErrorMessage("Business email domain required");                form.submitable(false);        } else { form.submitable(true);        }});

  1. form.onValidate(function() {

form.submitable(true);

        });

});

</script>

SanfordWhiteman
Level 10 - Community Moderator

The authoritative list of free (frequently interpreted as "non-business," though there are plenty of examples to the contrary) domains is the Freemail list. Also, that isn't really the right way to use the Forms 2.0 API.  But we digress...

Robb_Barrett
Level 10

One thing to remember is that if you ever go with a social login you don't want to force work-only emails. I don't know about you, but I use my personal email for LinkedIn.

Robb Barrett
Andy_Varshneya1
Level 9

That's a good point Robb. I'll have to keep that in mind, though I don't imagine the script impacting that flow as if leads are using social login, they should be created in our database via the API.

Robb_Barrett
Level 10

Couldn't you send out an "Update your address" email to all of your leads with personal email addresses (and here's a list: Free email provider domains ) and then lead them to a form with a temporary field designated as an Email field with a rule against having it be one of the email domains in this list?

Robb Barrett
Andy_Varshneya1
Level 9

Definitely an option, but historically I've seen very low response rates for campaigns like that where they don't have an incentive to participate.

SanfordWhiteman
Level 10 - Community Moderator

Great question and @Edward Unthank​ and I have talked about adding preliminary verification against a Marketo instance to Etumos Verify. The reasons it hasn't been rolled out are, to be totally frank, Edward's concern about demand (solved!) and my by-now-predictable concern about API calls and service resilience. If it's key to your application, I see no reason to not add it. 

As for doing this all client-side: if you're using Marketo-hosted LPs, I probably could help you make the "existing lead bypass" pretty close to bulletproof.

Andy_Varshneya1
Level 9

Love that you guys are thinking about this too!

It's probably an 85-15 split between Marketo hosted LP's and corporate website embedded forms. How much of a problem does that create?

Andy

SanfordWhiteman
Level 10 - Community Moderator

The advantage of having prefill easily available is you can, with some ugly/fanciness, use a background form as your lookup method: pre-post a form, check for fields that would only exist if the lead were merged with an existing lead (like your checkbox), return true/false, delete the pending lead.  To get that to work on an external site requires something more ugly/fancy.

Like Edward said (just saw that update come in!) this wouldn't make any diff for Etumos Verify, it would only be relevant if you tried to do it using all-native functionality.

Edward_Unthank_
Level 10

If it's an embedded Forms 2.0, then that'd create no problem at all for the script. The Email Verify Javascript is based on Forms 2.0, not Marketo-hosted landing pages versus non-Marketo-hosted landing pages.

Andy_Varshneya1
Level 9

Got it, then I'll have to look into that. I know some of the forms have been around for ages so they'll need to be dusted off and updated. I'm glad there's something available that addresses this specific issue we're facing though.

Mind if I reach out to one of you directly for more details?

SanfordWhiteman
Level 10 - Community Moderator

Sure, follow and DM either of us!

Edward_Unthank_
Level 10

Touché, Sanford.

Edward