What is Jquery's equivalent of php's FILTER
Possible Duplicate:
Validate email address in Javascript?
JQuery email validation?
I would like to use filter_Validate_email to validate email.val() instead of what is below.
var email = $("#email");
var emailReg = /^[A-Z0-9._%+-]+@([A-Z0-9-]+.)+[A-Z]{2,4}$/i;
if (!emailReg.test(email.val())) {
email.addClass("error").focus();
} else {
email.removeClass("error");
}
jQuery验证插件简单地保护了大量工作。
链接地址: http://www.djcxy.com/p/16512.html