I’ve seen examples of using jquery.validate to validate form fields but I have a situation where I have an email address as a string in an object and thought it would be nice to leverage the code in jquery.validate to test it.
Is there any way to do something like:
var isEmail = $.validate.email("abc@efg.com");
using the plugin?
If all you want is a function to strings, use the regex from validation plugin for “email” and create a function around it:
Example: http://jsfiddle.net/QuvSh/