Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Quote from whatwg HTML5 spec:
A valid email address list is a set of comma-separated tokens, where each token is itself a valid email address. To obtain the list of tokens from a valid email address list, an implementation must split the string on commas.
There are many examples around the internet of custom methods to add this support. For example, fromLeniel Maccaferri on stack overflow
jQuery.validator.addMethod( "multiemail", function(value, element) { if (this.optional(element)) // return true on optional element return true; var emails = value.split(/[;,]+/); // split element by , and ; valid = true; for (var i in emails) { value = emails[i]; valid = valid && jQuery.validator.methods.email.call(this, $.trim(value), element); } return valid; }, jQuery.validator.messages.email);
I'm happy to be able to define a custom method, but would like this support out of the box. As a user of an open source project that includes this library, I prefer this support be included instead of having to fork someone else's project code.