Not so simple, but it can be done with:
$.validator.methods.email.call( {optional:function(){return false}}, $('#email').val(), $('#email'));
This call will return true if it is a valid email address.
Brief explanation:
First line: you can call the authentication method for email directly
Second line: you must provide a method that returns false, which indicates that this field is not optional.
Third line: indicate the actual value
Forth Line: Provide the item, it really is not necessary, you could not provide anything, and it will work. The email authentication module accepts this element to check if it is optical. But since we provide a false value regardless of the argument we receive, it does not matter.
To make things a little easier, you can wrap this in your own plugin:
(function($){ $.fn.validate_email = function(){ var text = this.first().text(); return $.validator.methods.email.call( {optional:function(){return false}}, text, this); }; })(jQuery);
and name it $('#email').validate_email()
topek source share