Validate Comma Separated Email Jquery Validation Engine

Another quick tip, utilizing underscore and validation engine

function validateEmail(field, rules, i, options) {
   if (!_.all(field.val().split(","),
      function(candidate) {
         return $.trim(candidate).match(options.allrules.email.regex);
      })
   ) return options.allrules.email.alertText;
}

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>