Not validating email addresses
-
I have an email address field in a “Request a Quote” form that sometimes doesn’t get properly validated.
The regex for the email field is:
^\w+[-\.\w]*@(?!(?:apple|me|icloud|mac|gmail|hotmail|mail|aol|yahoo)\.(\w{2,4})|(co\.uk)$)\w+[-\.\w]*?\.\w{2,4}$/iIn summary, it’s case insensitive and looks for [someone]@[domain].[something]
It excludes lots of personal domains, like gmail.com, icloud.com, me.com, etc.In the last week I’ve had 3 gmail.com addresses come through. When I copy and paste these addresses into the form, it says it’s invalid. But the users could somehow submit the form with these invalid email addresses.
My guess is that some browser’s autocomplete is bypassing validation, or that a certain browser doesn’t support the kind of script that’s validating.
Is anyone else having this problem? My client is getting frustrated at the inconsistency, and so am I.
The page I need help with: [log in to see the link]
- The topic ‘Not validating email addresses’ is closed to new replies.