DShultz DShultz - 1 year ago 96
HTML Question

input type=email failing validation over 72 characters

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" />

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download