Apr 23, 20193:11 PM - edited Apr 24, 20192:20 AM
Not applicable
Form Email Validation - Block all providers except one
SOLVE
Hi,
I've created a form with 2 fields ie: Email and Name.
I would like to only accept submissions if the email address contains "@marc.com" and restrict all other domains (not just free providers) and display an error if the email entered is eg. @gmail.com, yahoo.com, etc
From what I gather, the form options only allow me to block domains and not block all and only whitelist a certain domain...
Any ideas or suggestions on how to implement this using onFormSubmit or any other methods?
Form Email Validation - Block all providers except one
SOLVE
Hi @Anonymous ! While we can tackle this in the opposite way in the HubSpot tool, i.e. block certain domains, we don't have a way to allow only a certain domain to be submitted. For this, you'd have to use some JavaScript to check whether or not the domain name matches the one you'd like to allow.
Something like this would work inside the onFormSubmit callback function on the form, or you could utilize global form events (onFormSubmit again) in order to tackle this issue. Something like this would work:
Form Email Validation - Block all providers except one
SOLVE
Hi @Anonymous ! While we can tackle this in the opposite way in the HubSpot tool, i.e. block certain domains, we don't have a way to allow only a certain domain to be submitted. For this, you'd have to use some JavaScript to check whether or not the domain name matches the one you'd like to allow.
Something like this would work inside the onFormSubmit callback function on the form, or you could utilize global form events (onFormSubmit again) in order to tackle this issue. Something like this would work: