Hi there,
i want to validate the number of characters in a textarea.
For example for a minimum of 50 chars. I already try to add this to my "class field": validate["length[50,156]"] which won't work.
Thx for your help.
Hi ridorsmhe,
I've not seen this requested before - I think that you'd have to do it with a Custom Validation function using jQuery to count the number of characters.
Bob
Hi! I also tried this in the class field of the textarea:
validate["length[0,300]"]
I have a jQuery script that counts the characters when ntyping and truncating this when the user types more then 300 characters. BUT: When text is pasted in this textarea (without any actual typing) this jQuery does not work. The full pasted text is submitted even when the char limit is reached.
So I looked for a way to add the 300 char limit validation to he chronoforms validation on submit. I read on the forum somewhere that Max suggested the code above. But I don't think this works in CF5? At least not when I try this ;-)
So if this is not the way to go about this, what would be the best and easiest way to create the validation for the max lenght of a text area? You mentioned a Custom Validation, but I'm not quit sure how to implement this for this scenario...
Kind regards,
Jip Jonker
Mmm, I changed my jquery 'counter' script on the textarea
FROM:
obj.keyup(function() {
TO
obj.bind("change keyup input",function() {
This way the jQuery script also truncates the text that is pasted into the field. Works for me!
Kind regards,
Jip