Reputation: 1401
I have validated input email in my code. Although the validation works in firefox, it will not work in Chrome. That is; when email addresses like 'example@' are submitted, chrome will take it as a valid email address, although in firefox it will be printed as Invalid. (But email addresses without @ will be printed as invalid)
Upvotes: 3
Views: 2329
Reputation: 11255
W3C draft about valid email adress for html5 input type="email"
:
A valid e-mail address is a string that matches the email production of the following ABNF, the character set for which is Unicode. This ABNF implements the extensions described in RFC 1123. [ABNF] [RFC5322] [RFC1034] [RFC1123]
email = 1*( atext / "." ) "@" label *( "." label )
label = let-dig [ [ ldh-str ] let-dig ] ; limited to a length of 63 characters by RFC 1034 section 3.5
atext = < as defined in RFC 5322 section 3.2.3 >
let-dig = < as defined in RFC 1034 section 3.5 >
ldh-str = < as defined in RFC 1034 section 3.5 >
This requirement is a willful violation of RFC 5322, which defines a syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too vague (after the "@" character), and too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use here.
So all of your cases aren't bugs because there is no strict compliance with other specifications and browser can implement email control on its own convenience.
Upvotes: 4