kmcamara
kmcamara

Reputation: 187

How to get fillable PDF to prompt for required fields when user saves?

I've created a fillable PDF form using Acrobat 10. I see where you can set form fields to be required, but all that does is outline the fields in red.

How can I get a prompt asking users to enter data in the required fields when they hit save?

Upvotes: 3

Views: 14543

Answers (1)

yms
yms

Reputation: 10418

You need to use Adobe-JavaScript if you want to achieve this.

Read this page in the Adobe documentation for more details:

Enforcing Required Fields

From that page, the code you have to include in your PDF file will look like this:

f = getField(event.target.name)
if (f.value.length == 0)
{    
   f.setFocus()    
   //Optional Message - Comment out the next line to remove
   app.alert("This field is required. Please enter a value.")
}

More details about the pop-up alert can be found here: https://acrobatusers.com/tutorials/popup_windows_part1

Upvotes: 3

Related Questions