We have a bunch of forms on our site, and all are either embedded HubSpot forms, or mapped to HubSpot forms in our CRM. We use the HubSpot block functionality to block a long list of email domains, including gmail.com. If someone submits a submission with a blocked email domain, it never goes into our CRM. (This was not my decision.)
On the mapped Webflow forms, people (spammers) routinely will put in their emails as for example, billj2387427@gmail
without the .com.
Is there a way to block words that aren’t domain names from being entered in the form fields? Thank you.
Custom code can be used to check the value of the email field for patterns that you would like to block. However the best approach is always on the server side and with Webflow that means using a third-party form processor or middleware to handle your logic before passing it to your endpoint (hubspot).
EDIT: Apologies Jeff, didn’t see your reply. I needed to fix a codeblock wrapping issue on my page before I clicked send.
Andrea, as Jeff points out, server-side validation is always best, however I do like to couple that with client-side validation just for the UX benefits. No sense even sending the data if we can catch bad data in the client.
To do this I usually set the input as an email type input and also add a pattern that is more restrictive towards modern email formats.