Timeline for How can I validate an email address in JavaScript?
Current License: CC BY-SA 4.0
18 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17 at 18:05 | comment | added | Roko C. Buljan |
as @StefanGarofalo said, all it takes is for an attacker to inspect-element (your FORM), remove the required attribute and modify the type and just submit the form (either by click or JS). This answer makes no sense. UI is not backend validation, and it should never be treated as such.
|
|
Dec 14, 2023 at 11:19 | comment | added | StefanGarofalo | This is wrong, you can change the markup from the inspector and bypass the validation. It should be done only for the ux, but its not enough on its own | |
May 19, 2023 at 19:30 | review | Suggested edits | |||
May 20, 2023 at 0:39 | |||||
Jul 5, 2022 at 12:37 | history | edited | Andy | CC BY-SA 4.0 |
don’t give inaccessible examples (:
|
Dec 7, 2021 at 21:37 | comment | added | Thomas Champion |
@KNP Multiple @ is valid only if the extra "@" appear in username part and is wrapped in double quote. It seems that also the second point (missing extension) is not valid anymore since 2013 (icann.org/en/announcements/details/…), but yes it depends, I guess someone could consider extension optional. Finally, I choose the module address from joi: joi.dev/module/address/api/?v=4.1.0#emailisvalidemail-options to validate email addresss in my app.
|
|
Dec 6, 2021 at 18:26 | comment | added | KNP | @ThomasChampion Multiple "@" IS valid. First point is valid though. | |
Oct 22, 2021 at 15:30 | comment | added | Thomas Champion |
At first I found this answer useful, but I tried with some invalid email address and the regex said there were valid... by example : bar@domain (extension is missing), A@b@[email protected] (multiple @) and so on (cf en.wikipedia.org/wiki/Email_address#Examples). I found a nice regex here: emailregex.com
|
|
Oct 5, 2021 at 6:03 | history | edited | Sebastian | CC BY-SA 4.0 |
Formatting
|
Dec 3, 2020 at 21:01 | history | edited | maxshuty | CC BY-SA 4.0 |
Updating the regex as the spec on the source listed has changed.
|
Jun 6, 2019 at 6:49 | history | edited | Harshad Prajapati | CC BY-SA 4.0 |
as you are edited in your jsFiddle required for not let leave empty input filed
|
Jan 7, 2016 at 15:06 | history | edited | TachyonVortex | CC BY-SA 3.0 |
Added relevant documentation from the HTML5 spec
|
S Sep 25, 2015 at 6:59 | history | suggested | CommunityBot | CC BY-SA 3.0 |
Change jsFiddle Link
|
Sep 25, 2015 at 6:23 | review | Suggested edits | |||
S Sep 25, 2015 at 6:59 | |||||
Jun 5, 2014 at 9:00 | history | edited | Peter Mortensen | CC BY-SA 3.0 |
Second iteration.
|
Jun 5, 2014 at 8:41 | history | edited | Peter Mortensen | CC BY-SA 3.0 |
Copy edited.
|
Sep 11, 2013 at 2:21 | history | made wiki | Post Made Community Wiki by pera | ||
Nov 12, 2011 at 0:08 | comment | added | Jason |
this is good, but the problem with this is that it must be inside a form tag and submitted by a submit input, which not everyone has the luxury of doing. Also, you can't really style the error message.
|
|
Oct 17, 2011 at 8:23 | history | answered | Anoop | CC BY-SA 3.0 |