You would use regular expressions for this. Something like ^.{0,50}$
-
This reply was modified 5 years, 6 months ago by bgermann.
Thank you for your response and suggestion. I tried this:
Presenter Bio for Brochure (50 words or less)|Enter no more than 50 words|^\W*(?:\w+\b\W*){1,50}$|err:Enter no more than 50 words
Which seemed to work perfectly. When I entered more than 50 words it gave me my error. When I entered less than 50 words it passed and posted.
However there seems to be a problem. The data in the field is not posted. I only get blanks even when there are fewer than 50 words.
I first entered 60 words, got an error, reduced it to 40 which posted but I received no text in the field. I next simply entered 10 words and posted but received no text in the field. All other fields post their data so it seems as if when there is a regx that the data isn’t posted, unless I am doing something else wrong. The text above is exactly what is in the field definition.
Thanks in advance for any help.
Marc
Your RegEx works fine for me on cformsII 14.14 and PHP 7.2.11.
-
This reply was modified 5 years, 6 months ago by bgermann.