With FormMaker, not only is it possible to produce fully-formatted Acrobat forms in InDesign as with FormMagic, it is even possible to attach Acrobat validation scripts to each form field right inside InDesign.
In this post, I will take you through the steps necessary to add an all-caps validation script to your PDF form, using FormMaker.
The end result will be an Acrobat PDF form in which a text field will be designated as a capital-letters-only field. Whatever the user types in will be converted automatically to all caps.
The first step is to design a simple form in InDesign. Here’s the one I’ll be using:
In this example, I want to make sure that the name the user types into field 1 (“Name of Organization”) will always be in all-capital letters. So, even if they type “Ace Design Agency”, as soon as they focus out of the field in Acrobat, I want that to change to “ACE DESIGN AGENCY”.
The way to do this in Acrobat is to attach a script to the validation event of the form field. Select the field in Acrobat with the black arrow, click on “Properties”, go to the “Validate” tab, and add the necessary script, as in the following screenshot:
The problem with doing this in Acrobat, though, rather than in InDesign directly, is that every time a change is made to the form, that change will have to be made in InDesign, meaning that all the validation scripts will need to be added again to each field after the form is re-exported to Acrobat.
If there are many rounds of revisions and updates, clearly this is a huge waste of time.
It would be great to be able to add such scripts to the form directly in InDesign. That way, it would only be necessary to do it once, no matter how many rounds of corrections there are.
Using FormMaker, this is possible, and it’s is as easy to do in InDesign as in Acrobat. The steps are as follows:
- Open the form in InDesign.
- Select the form field to which you would like to add an Acrobat validation script.
- Open the “Script Label” panel in InDesign (Window > Utilities > Script Label).
- Paste your Acrobat script into the Script Label panel. So now it should look like this InDesign screenshot:
Repeat steps 2–4 for each field to which you would like to add a validation script.
Once that is done and the form is complete in InDesign, run FormMaker in InDesign, export to interactive PDF as usual, and run FormMaker again in Acrobat.
Now, apart from all the visual formatting that is restored, FormMaker also restores all validation scripts to each field appropriately.
Here’s the actual PDF to test the result out on. To see the validation script in action, type something with lowercase letters into field 1 (e.g. “Ace Design Agency”). Tab out of the field, or click into a different field, and notice how the text of field 1 has been changed to all-capital letters.
Don’t forget: Everything in this form was created directly in InDesign with FormMaker, including the font, color, alignment, and even the comb fields!
Of course, converting user entries into all-capitals is only one of an infinite number of things that can be done. Other common uses might be to check the validity of an email address, or to limit entry to a range of numbers, to check for valid dates or a range of dates, and so on.
If you need help writing the Acrobat validation script you require, we’d be happy to help with that.
So, if you think FormMaker could save you a lot of time and hassle, get in touch for a quote.