These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Word Count Validation

Mr.Jiggs
Registered: Apr 11 2006
Posts: 39

I'd like to limit the input in an AcroForm text field by the word count (versus the built in character count). How can I do this ?

Mr. Jiggs

Mr. Jiggs

My Product Information:
Acrobat Pro 8.0
Mr.Jiggs
Registered: Apr 11 2006
Posts: 39
I figured it out. First I had to remember to not try to edit a form I had already applited the "reader rights" to (d'oh!). Then I added the folowing script to the Validation of a TextField named "BioText" to warn if more than 300 words had been entered:

var f=this.getField("BioText").value;
var aWords = f.split(" ");
var nNumWords = aWords.length;

if (nNumWords > 300) {
app.alert("You have entered too many words.\nI count around " + nNumWords + "words.\nPlease reduce the amount of your text.");
}

Mr. Jiggs