How can I integrate word count into bassistance.de validation? For example, i dont want people to enter more than 50 words, and it should show an error to indicate it.
<form action="done.php" method="post" id="mainform" class="validate">
<textarea name="message" rows="4" id="message" class="required" ></textarea>
</form>
Here is all I have, but i dont know where to go from here
$(document).ready( function() {
$("form.validate").validate({
submitHandler: function(form) {
form.submit();
}
})
});
any assistance here would be appreciated, i’m not familiar with this plugin at all.
I would go with a minimum charachter count, based on what you think is the average word length (I still stand behind 5). So that would be:
Update:
If ajax is an option, you could use the
remoterule. I think it would along the lines of:I’m having some issues with it, with the timing, but I think some of that is just me rushing things, but it does work. In this case, the remote script must return
truefor the element name, so my php script looks like: