victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

Word Count Validation #702

Open btafoya opened 6 years ago

btafoya commented 6 years ago

Any suggestions on using this library for word count validation? Thanks in advance!

chrisjohnstone commented 6 years ago

What have you tried?

This gets you some way there.

var total = value.split(' ').filter(function(v){return v!==''}).length;

if(total < 251) {
    return true;
} else {
    return false;
}