Mobile app version of vmapp.org
Login or Join
Courtney195

: Input type="email" allows test@test, why? I've always been under the assumption that the browser email-validation-regex is more robust than some regex pattern in JS/PHP. My employer just showed

@Courtney195

Posted in: #Email #Firefox #Validation

I've always been under the assumption that the browser email-validation-regex is more robust than some regex pattern in JS/PHP.

My employer just showed me that both strings are considered correct (at last in FF28):

test@test.com // Expected to be true, is true
test@test // Expected to be false, is true


Why is the latter true? Is this a bug, or something for the future? Because as far as I can tell, it's not correct to not use a extention (apart from maybe localhosts).

Anyone who can shed some light on this?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

3 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

Note also that web browsers are not required to perform any validation checks. Older browsers don't do anything special with the email address. Newer browsers may validate, but the 'email' type is most useful on mobile devices where a specialized keyboard may be shown to the user.

10% popularity Vote Up Vote Down


 

@Moriarity557

You could edit your hosts file or run a DNS server on a local network to create a machine with a top level domain name. The email address will be only accessible if it's routed only within that local network but it's a possible configuration.

10% popularity Vote Up Vote Down


 

@Sarah324

It is valid because test could be a top-level domain and localpart@top-level-domain is a valid email address.

See for example Email address, domain part

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme