SOLVED

How to Restrict Free Email Domains on Form Fill Out in 2021

Go to solution
Chris_Goelkel
Level 2

Is there a new way to do this since this old Blog Article in 2014. This doesn't seem to work for me. 

If you reference this old post (https://developers.marketo.com/blog/restrict-free-email-domains-on-form-fill-out/) it says you can block whatever domain you want on the front side of the form. But I believe some calls have changed, and the script is not working.  Has anyone else run across this issue?

 

This seems like a out of date method, is there a better way?

2 ACCEPTED SOLUTIONS
SanfordWhiteman
Level 10 - Community Moderator

Use the new FormsPlus::EmailPattern JS.

 

You can see a demo here:

 

MktoForms2 :: FormsPlus-EmailPattern [simple demo]

 

Download the JS library from the CodePen HTML pane (direct download link here) and re-host it in your Design Studio.


Then add the code from the CodePen JS pane anywhere after your form embed. Add blockable domains to the invalidDomains array. It accepts 3 different formats:

 

mailbox@example.com  - matches one specific email address

example.com - matches all mailboxes @ that domain

mailbox@ - blocks that mailbox @ any domain

 

(actually it does even more cool stuff but I haven't had time to document it yet!)

View solution in original post

SanfordWhiteman
Level 10 - Community Moderator

Because they failed to account for onValidate chain in their code, setting submittable(true) no matter what else was running.

View solution in original post

36 REPLIES 36