Forms 2.0 custom validation script blocks web-based email domains

Anonymous
Not applicable

Forms 2.0 custom validation script blocks web-based email domains

Has anyone figured out or written a script that can be used with Forms 2.0 that will validate and block web-based email domains, such as @gmail, @hotmail, @yahoo, etc? The script should return an error message that informs the form-filler-outer their email is not acceptable, and block submission of the form until the validation is satisfied. I would LOVE to see a copy of that script if one exists. There's no example of a script like this on the Developers Forms 2.0 page: Forms 2.0 » Marketo Developers

I'm not a developer and cannot write a script so if anyone has figured this out I would be ETERNALLY grateful. Thanks!

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Forms 2.0 custom validation script blocks web-based email domains

There's this old(ish) chestnut: MktoForms2 :: Force "Corporate" Email - JSFiddle

But bear in mind that there aren't just a handful of such domains.  If you want to be complete, the giant, canonical list is here: http://svn.apache.org/repos/asf/spamassassin/trunk/rules/20_freemail_domains.cf

Rather than maintaining a copy of the freemail list in JS, you might consider using an email validation service that classifies domains into free/non-free (in addition to validating address existence).

Mel_Dadoly
Level 3

Re: Forms 2.0 custom validation script blocks web-based email domains

Hi Diana,

We have an example of a script like this in a blog post on the developer site. You may find this useful:

http://developers.marketo.com/blog/restrict-free-email-domains-on-form-fill-out/

Anonymous
Not applicable

Re: Forms 2.0 custom validation script blocks web-based email domains

Thank you Mel! I'm excited to try this script. Really appreciate your help on this.