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

12,050

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

Share:
12,050
kmcamara
Author by

kmcamara

Updated on June 05, 2022

Comments

  • kmcamara
    kmcamara almost 2 years

    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?