Step 1: Check us out

You don't have to be a member to look at any content on the site. Increase your expertise with our helpful tutorials, videos, forums, and sample PDFs.

Step 2: Sign up for a free account

Like what you see? Take the next step and become a member. Register now to get discounts, attend eSeminars, ask questions and more.

Step 3: Start participating

Get the most out of your membership. Post in the forums, create your profile, submit to the gallery, attend a user group meeting. Log In now.

Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2008-12-18 12:28:48

Mr.Jiggs
Member
Registered: 2006-04-11
Posts: 13

AcroForm Word Count Validation

I'd like to be able to limit a text field by word count, versus the built in character count. How can I do this ?

Mr. Jiggs


My Product Information:
Acrobat Pro 8

Offline

 

#2 2008-12-19 10:53:12

Mr.Jiggs
Member
Registered: 2006-04-11
Posts: 13

Re: AcroForm Word Count Validation

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.");
}

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson