Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Issue in Email validation #16022

Closed
3 tasks
ghost opened this issue May 31, 2017 · 3 comments
Closed
3 tasks

Issue in Email validation #16022

ghost opened this issue May 31, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented May 31, 2017

My very new to angular js. while exploring it , i got this issue.

**I'm submitting a ... bug report **

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior: If you are validate a email address m@g the result says its true.

Expected / new behavior: Expected
my expection is m@g have to say false. when the input contain (@ .) symbols only it have to say true.

Minimal reproduction of the problem with instructions:

Angular version: 1.x.y

Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Anything else:

@EmmanuelDemey
Copy link
Contributor

EmmanuelDemey commented May 31, 2017

Do you use <input type="email"> ?

@frederikprijck
Copy link
Contributor

frederikprijck commented May 31, 2017

According to RFC 5321 - 2.3.5:

A domain name (or often just a "domain") consists of one or more components, separated by dots if more than one appears.
[...]
These components ("labels" in DNS terminology, RFC 1035) are restricted for SMTP purposes to consist of a sequence of letters, digits, and hyphens drawn from the ASCII character set.

This means that the part appearing after the @ is allowed to have a single segment.

Also ensure to read the following issue/PR, which are also discussing email validation in AngularJS:
#15864
#14719

@Narretz
Copy link
Contributor

Narretz commented May 31, 2017

m@g is a correct email. If you need stricter validation, you can use pattern or use one of the techniques from the forms guide: https://code.angularjs.org/snapshot/docs/guide/forms

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants