uoay
uoay

Reputation: 326

Multiple attribute for <input> type="email" does not work

I activate multiple attribute for a <input type="email">, eg <input type="email" multiple>

However, as I entered two email addresses (like [email protected] [email protected]) and submitted, an error message displayed saying

A part following '@' should not contain the symbol '@'*.

I tried the multiple attribute for <input type="file"> (<input type="file" multiple>) and it was working well. Could anyone help me to explain this? Thanks.

Upvotes: 0

Views: 2374

Answers (2)

HoldOffHunger
HoldOffHunger

Reputation: 20931

If you want to disable browser-based email validation altogether, then change your code to...

<input type="text">

UTF-8 characters can trigger validation on the type="email"-HTML type in browsers. Of course, RFC6531 does allow UTF-8 in e-mail addresses, popular services like Gmail and Zohomail support UTF-8 addressed email, and in QMail (the massively-popular, Linux email server) also supports it.

ñ@gmail.com will trigger this e-mail validation message, even though RFC6531 supports it, so, until that is fixed, just use type="text".

Upvotes: 0

Oriol
Oriol

Reputation: 26

As it's detailed in the MDN web docs:

multiple

A Boolean attribute which, if present, indicates that the user can enter a list of multiple e-mail addresses, separated by commas and, optionally, whitespace characters. See Allowing multiple e-mail addresses for details.

In the form, you have to put the different emails separated with comma: [email protected], [email protected]

Upvotes: 1

Related Questions