Skip to main content
Level 2
Apr 9, 2021 3:58 PM UTC
Solved

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

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?

SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Apr 9, 2021 6:21 PM UTC

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!)

36 replies

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Apr 9, 2021 6:21 PM UTC

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!)

Translate
Level 2
Apr 9, 2021 10:14 PM UTC

Thanks @sanfordwhiteman 

I am trying to make this work, but first try was unsuccessful. 

You Said I should upload a copy of that JS to my Marketo Library correct, then call that version. It's acting like it's not calling it.

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Apr 9, 2021 10:24 PM UTC

You'd need to provide a link to your page. Can't tell what's going on without that.

Translate