jQuery validation plugin multiple email addresses

Solution 1:

Here's a custom made function added with the help of the addMethod:

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
);

Here's a jsFiddle that shows you how to use the multiemail custom method:

http://jsfiddle.net/leniel/xFphm/7/