5 ms·
As somebody else said, don't. If you really feel you need some kind of validation, have two email fields so the user can enter it twice and double check it the
by jlarocco 14y ago
As somebody else said, don't.
If you really feel you need some kind of validation, have two email fields so the user can enter it twice and double check it themselves. No matter how much effort you put into it, and how complicated your validation code is, if the users want to mess with you, they can always just enter a valid fake address, so there's no point wasting a lot of energy on it because it's easy to defeat anyway.
And since it's impossible to validate addresses with a regular expression, there's a small chance you'll reject a valid address and look dumb.
- michaelhoffman 14y agoI see the two fields thing a lot. It's pointless since I can copy and paste into the second field. Unless they use JavaScript to disable pasting, which is obnoxious.
- mikeash 14y agoI'd wager that being likely to mistype one's own e-mail address correlates highly with not realizing you can copy/paste between the fields.