Restrict Free Email Domains on Form Fill Out

September 9, 2014 | by

Let’s say you would like to restrict site visitors from submitting a form with a free email domain, such as Gmail or Yahoo. To accomplish this, include the script below in the source code of the page with the Marketo form.

It will check if a user entered a non-business email (Gmail, Hotmail, etc.), and prevent Marketo form submission if a user enters one. You can extend the list of blocked email domains by modifying line 9 to include domains you would like to restrict.