Use the addMethod()
method to create your custom rule.
Example:
jQuery.validator.addMethod("maxwords", function(value, element, params) {
// your function to count words goes in here
// use any of these arguments in your function: value, element, params
// value => the present value of the field being tested
// element => the present field being tested
// params => the parameters passed in when you declare the rule.
// example: // maxwords: 1 // params[0] would be 1
// return true // if the field passes validation
// return false // if the field fails validation and the message below will display
}, "Please enter at least {0} words."));