Skip to main content
1 of 4
Jaimin Sutariya
  • 11.1k
  • 5
  • 36
  • 71

You can add custom validation class like below in your js file

Validation.add('validate-comma-separated-emails', 'Please enter a valid email address.', function(emaillist) {
    var emails = emaillist.split(',');
    var invalidEmails = [];
    for (i = 0; i < emails.length; i++) { 
    var v = emails[i].trim();
        if(!Validation.get('validate-email').test(v)) {
            invalidEmails.push(v);
        }
    }
    if(invalidEmails.length){ return false; }
    return true;
});

Now use validate-comma-separated-emails in your text field.

Jaimin Sutariya
  • 11.1k
  • 5
  • 36
  • 71