jQuery regex validation of e-mail address including blank value
I am using custom[email] rule for email validation in Jquery Validation
Engine. What I want is, I want regex that validates email with blank value
also. If value is blank then also it should show error message. I dont
want to use required rule.
Here is the custom rule given in Jquery Validation Engine
"email": {
// HTML5 compatible email regex (
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#
e-mail-state-%28type=email%29 )
"regex":
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
"alertText": "* Invalid email address"
}
Please help me out.
No comments:
Post a Comment