SOLVED

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

Go to solution
plane
Level 2

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

Awesome, thank you @SanfordWhiteman!! You should definitely work this into a blog post, it'd be helpful to see the build out explained!! I'd also love to see what other cool stuff the email validator script does.

plane
Level 2

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

One other question now that you've updated these @SanfordWhiteman - do I need to re-pull teknkl-formsplus-emailpattern-1.0.3.js from your direct download link, or just copy the updated JS from the codepen/forum post?

SanfordWhiteman
Level 10 - Community Moderator

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

The external JS didn't change. Just the way the onValidate listener works.
plane
Level 2

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

@SanfordWhiteman, I'm having a little trouble with this now that I'm doing some additional testing. It looks like the validation works (I get the error/alert if I use an email on my disallow list) but when I correct the email to an allowed one AFTER having tried a disallowed one, the form won't submit. Any thoughts as to what might be causing this?

VDimitrov
Level 1

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

@SanfordWhiteman I'm having the same issue as Plane: form validation works when an incorrect email is entered, but after changing it to a valid email, the form does not submit. Refreshing the page and entering a valid email does work. Any insight on how to fix that and make it submit when changing an incorrect email to a correct one?