Hi
Am trying to validate multiple email address but it's not accepting the external method what I've got from doing the research.
Ref: http://jsfiddle.net/leniel/xFphm/7/
$validatorProvider.addMethod("multiemail", function (value, element) {
if (this.optional(element)) {
return true;
}
var emails = value.split(/[" "]+/); // spliting the email using space
console.log(emails);
valid = true;
for (var i in emails) {
value = emails[i];
valid = valid && $validatorProvider.email.call(this, $.trim(value), element);
}
return valid;
}, "Invalid Email address");
If I'll use the single email address then it will throw the below error:
If I'll add the multiple email address then it will throw the normal email validation error:
Please Help to resolve the issue/bug asap.
Thanks in advance
Hi, $validatorProvider.email does not exist. You can use the method from jQuery validate directly: jQuery.validator.methods.email (or $.validator.methods.email).
Hi Am trying to validate multiple email address but it's not accepting the external method what I've got from doing the research. Ref: http://jsfiddle.net/leniel/xFphm/7/
If I'll use the single email address then it will throw the below error:
If I'll add the multiple email address then it will throw the normal email validation error:
Please Help to resolve the issue/bug asap. Thanks in advance