1
votes

On testing an HTML form with a email input text box, I'm noticing that any email address over 72 characters fails validation: "Please enter an email address" in both Chrome and Firefox. I didn't realize the validation for input type=email limited to 72 characters, and can't find any documentation about it, W3C or otherwise:

<input type="email" style="width:800px" maxlength="100" />
1
I'm unable to replicate: jsfiddle.net/1vapLLfv Can you give an example of an email address that fails? (But change the domain for privacy.)Rick Hitchcock
Yup. This works as intended. No error-messages for "valid" email-addresses. So your example isn't complete - there is something else causing an error, not the code you posted above.junkfoodjunkie
same here it seems to work , i am able to enter 100 characters into the input field no problem.Saa_keetin
Interesting, there is no error for the default value in that fiddle of 12345678901234567890123456789012345678901234567890123456789012345678901234567890@example.com, but the value I've been testing with does fail: test@testtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt.com whether you put the long string of t's before of after the @ symbolDShultz
That's longer than 100 characters, but I can confirm that it fails even if you reduce it to 100 characters. So it's an issue with the domain part of the email.Rick Hitchcock

1 Answers

1
votes

According to RFC1035 - Domain Names - Implementation and Specification, here is the syntax:

<domain> ::= | " "

<subdomain> ::= <label> | <subdomain> "." <label>

<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]

<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>

<let-dig-hyp> ::= <let-dig> | "-"

<let-dig> ::= <letter> | <digit>

<letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case

<digit> ::= any one of the ten digits 0 through 9

Note that:

Labels must be 63 characters or less.

The example domain name in your comment is greater than 63 characters, hence the failure to validate.