Implementing form data validation for email? | Community
Skip to main content
Andy_Varshneya1
New Participant
April 12, 2016
Solved

Implementing form data validation for email?

  • April 12, 2016
  • 4 replies
  • 6960 views

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

Best answer by SanfordWhiteman

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.

4 replies

April 14, 2016

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="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
New Participant
April 14, 2016

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
New Participant
April 12, 2016

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
New Participant
April 12, 2016

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
New Participant
April 12, 2016

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
New Participant
April 12, 2016

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
SanfordWhitemanAccepted solution
New Participant
April 12, 2016

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.

Edward_Unthank_
New Participant
April 12, 2016

Touché, Sanford.

Edward