if(jQuery.trim(jQuery(“#custom-email-input”).val()) != ”) {
var sCustomemails = jQuery(“#custom-email-input”).val().split(‘,’);
jQuery.each(sCustomemails, function(index, email) {
if(!validEmail(email)) {
jQuery(“#custom-email-input”).addClass(‘error’);
alert(‘Please enter only valid email addresses.’);
jQuery(“#custom-email-input”).attr(‘placeholder’,’Please enter only valid email addresses’);
error=true;
} else {
jQuery(“#id_subject”).removeClass(‘error’);
}
});
}