FormMaker Help

Using FormMaker

Note: This page is for the latest version of FormMaker (version 3.0 and up). For help with older versions, click here.

1.   Introduction

FormMaker is an InDesign add-on that makes it easy to create fully styled, interactive, fillable PDF forms in InDesign.

FormMaker includes all the features that are included in FormMagic to set the visual appearance of form fields, using the native, familiar InDesign way of applying formatting (fonts, color, alignment, etc.) to text.

Additionally, FormMaker lets you add many of the rich interactive features that are available natively in Acrobat to your PDF document and form fields – all in InDesign – in a user-friendly way without needing to write a single line of code, including field formatting, validation, and calculation.

With FormMaker you can also write custom keystroke, formatting, validation, calculation, and mouse- and keyboard-action JavaScripts, as well as adding document-level JavaScripts to your form.

So, in fact, with FormMaker you can add almost all the interactivity available in Acrobat to your interactive PDF forms – directly in InDesign.

This short guide will focus on how to add formatting, validation and calculation interactivity to your fillable PDF forms in InDesign with FormMaker, as well as mouse and keyboard events, and document-wide JavaScripts that run whenever the document is opened in Acrobat.

1.0 Installation

The instructions for installing FormMaker are the same as for FormMagic, and can be found in the downloaded package. 

1.1   Using FormMaker to Set the Visual Appearance of Fields and to Create Comb Fields

To learn how to format the visual appearance of form fields (whether text fields or dropdown lists, etc.) and how to create comb fields, refer to the FormMagic help page. FormMaker includes all of FormMagic‘s features, so everything written in that guide is applicable to FormMaker as well.

1.2   What Kind of Form Interactivity Can be Added with FormMaker?

Almost anything that can be done to a form field in Acrobat can now be done to a form field directly inside InDesign. FormMaker basically brings Acrobat’s form-field Properties dialog box to InDesign.

With FormMaker you can mark a form field in InDesign as a number field, date field, percentage, or zip field, and more. If it’s a number field, you can validate the range (force the numbers to be within a certain range). You can easily set field Z to display the sum (or product, or average, etc.) of fields X and Y – just as you can in Acrobat.

Additionally, with FormMaker, custom document, validation, calculation and formatting scripts can be added.

And with FormMaker, scripts can be made to run when mouse and keyboard events occur.

One example of using custom scripts would be to disable certain fields in your form based on your user input. For instance, if checkbox A is checked, Question 1–3 will become grayed out.

2.   Adding Interactivity to Form Fields with FormMaker: The Basic Idea

Step 1: Run FormMaker, select a form field in your document, and set its properties.

Run FormMaker by double-clicking on it in InDesign’s Scripts panel. The following window will appear (the exact settings will change depending on what is selected in InDesign).

FormMaker Pro UI

You can continue working in InDesign while this window is open. (But if you’re not working on forms, it’s best to close it.)

Select a form field in your InDesign document. The FormMaker window will update to show any formatting that you have applied to that form field.

There are five tabs at the top of the window (Document, Actions, Format, Validate, Calculate). Each tab contains several options that you can apply to the selected form field in InDesign. (Note that you can only apply these options to a single field at a time, even if you have selected multiple fields in InDesign.)

  • Document tab: Here you can add custom JavaScripts that will be automatically run whenever the user opens the PDF form in Acrobat Reader. To add a document script to the PDF, type the name of your document script, and click Add.
  • Actions tab: Here you can add custom JavaScripts that will be run when specific events occur in the PDF form. Select the type of event from the dropdown, and click the Edit button to add a custom JavaScript that will be run when that event occurs. The available events are: mouse up, mouse down, mouse enter, mouse exit, on focus, on blur.
  • Format tab: Here you can impose the selected formatting on numeric data entries. You can force a text field to only accept specific types of entries. The available options are: Number, Percentage, Date, Time, Zip Code, Zip Code + 4, Phone Number, and an arbitrary mask. The Custom option “makes additional options available to form designers who want to write their own JavaScripts for formatting and keystrokes. For example, a custom script could define a new currency format or limit the user entry to specific keystroke characters” (Adobe.com).
  • Validate tab: “Validation properties restrict entries to specified ranges, values, or characters, ensuring that users enter the appropriate data for a specified form field” (Adobe.com).
  • Calculate tab: “Use these options to perform mathematical operations on existing form field entries and display the result” (Adobe.com).

Tip: If you set a text field to be formatted as a number and you check the box marked “Use red text” (shown in the screenshot above), this will force all negative numbers to become red. But it also forces all positive number to become black! These red and black colors will override the color you have set for text in the field, so all text will be either red or black only in that field. If you need to use a different color for the numbers in this field, do not use this option. (This reflects how Acrobat works, it is not specific to FormMaker.)

The FormMaker window is interactive, and two-way. As you select different form fields in your document, the options you have chosen for that field will appear in the FormMaker window.

The window is very similar in functionality to Acrobat’s own form field Properties window. Indeed, to learn more about it, I recommend you check out Adobe’s own help page for Acrobat’s dialog box.

See below, in Section 2, for more details about the FormMaker window, and especially about what’s missing from it compared to Acrobat’s Properties dialog box (and why that’s not a bad thing at all)!

Step 2: Click on the Create Interactive PDF button, export the form to Acrobat, and run FormMaker in Acrobat.

Once you have finished formatting your form and adding interactivity to the form fields in InDesign, click on the “Create Interactive PDF” button at the bottom left of the FormMaker window.

Create Interactive PDF button

Important! You MUST click on the “Creative Interactive PDF” button at the bottom of the FormMaker dialog box to create your interactive PDF. Using InDesign’s File > Export method will not work.

A new window will open. Here you can select the PDF file you wish to create. If you want to display InDesign’s PDF Export Options dialog, check the box. Otherwise, FormMaker will use your previous settings. The new interactive PDF form will open in Acrobat (unless you specifically disable this option in the Export Options dialog).

Export PDF Dialog in FormMaker

In Acrobat, you should find a new command at the bottom of the Edit menu called FormMaker. (If you do not see this command, FormMaker has not been properly installed. Refer to the installation guide for help.)

Run this command and all FormMaker information attaches to the appropriate fields: The correct font, color, alignment, scripts, and more, are applied to each field.

Save your PDF form at this point, and you’re done! Anyone opening the PDF on any desktop computer with the free Adobe Reader will now be able to use the fully formatted, interactive form!

It is important to note that the interactive PDF that FormMaker creates is a standard, plain-vanilla interactive PDF. There is nothing special about it. The end-user will not know it was created with FormMaker, and they will not need any extra plugins or add-ons to open the PDF in Adobe’s free Acrobat Reader. Likewise, the fonts you have used to style your PDF form will be embedded in the PDF and will travel with it, so when the end-user fills in the form, they will be typing with the fonts you or your designer has chosen, even if those fonts are not installed on the end-user’s system!

(Be aware that for reliable results, the user must open the PDF on a desktop computer using free Adobe Reader software. Opening the PDF in a browser, or on a tablet, or with non-Adobe software might lead to unexpected or incomplete results. There are many different PDF-reader applications out there, and not all of them support all PDF features. Moreover, on a tablet, at the time of writing, not even Adobe’s own reader supports all features that can be added with FormMaker. So again, for consistent, predictable results, the user must be told to open the PDF on a desktop computer with Adobe’s own free PDF reader software.)

TIP: To reduce the PDF file size, before distributing the PDF run the “Purge FormMaker Data” command (it’s the last entry in the screenshot above). This removes the extra data that FormMaker uses initially. Doing so will not affect the PDF in any way. It just deletes FormMaker‘s unused and now redundant metadata.

2. Where Are the Missing Tabs?

If you are familiar with Acrobat’s Properties dialog box, you will notice that there are four major tabs missing from FormMaker’s dialog box: General, Appearance, Position, and Options.

In most cases, all the functionality these tabs offer is available in InDesign. In fact, in most cases it is much easier to apply these settings in InDesign than in Acrobat! I’ll go through them one by one:

General tab: The options here include the field’s name, visibility, read-only property, etc. Most of these options are available in InDesign’s Buttons and Forms panel (Window > Interactive > Buttons and Forms). As a general principle, FormMaker must be used alongside InDesign’s Buttons and Forms panel, as many form field options are available only there.

Appearance tab: Options here include the font, size, text color, border and fill of the form fields. With FormMaker it is much easier to apply font formatting, since this can be done with InDesign’s native tools (including paragraph and character styles). Much better than fiddling around in an inconvenient dialog box! For more info on how to apply these settings with FormMaker, see the FormMagic help page, as everything there pertains to FormMaker as well. Use InDesign’s native tools to set the fill and border properties of your form fields.

Position tab: Again, this is redundant. InDesign’s tools are, of course, far superior to Acrobat’s for this sort of thing.

Options tab: The alignment of the text in the field is set using InDesign’s native alignment options (see FormMagic help). Most of the other options in this tab are available in InDesign’s Buttons and Forms panel.

Finally, the Actions tab in Acrobat allows you to apply any one of over a dozen actions to each of the six mouse and keyboard events. Again, almost all of these are available in InDesign’s Buttons and Forms panel. So all that’s left for FormMaker to add is the powerful ability to add custom JavaScripts to each of these events. To do so, select the event from the dropdown list and click the Edit button to attach a custom JavaScript to that event. The events to which you have attached JavaScripts will be listed in the Actions area of the tab.

The final missing functionality is Acrobat’s (somewhat hidden) Calculation Order dialog box, which is important for setting the calculation order of form fields. This will be discussed next.

3.   Setting the Calculation Order

Calculation scripts need a bit of care! Remember that the way Acrobat works is that when the value of any field changes all the calculation scripts in the PDF are run, one by one.

Clearly, the order in which the calculations are run is vitally important!

For instance, if you have 10 “subtotal” fields and 1 “total” field in a PDF form, the values of the subtotal fields must be calculated before the total field is calculated, otherwise the total could be wrong!

In Acrobat, a special “Calculation Order” dialog box allows the user to arrange the fields in the correct order for proper calculation of form values.

Luckily, with FormMaker maker it is just as easy to set the calculation order of fields directly in InDesign, although the method is different than Acrobat.

With FormMaker, a number at the end of the name of a form field (which is set in InDesign’s Buttons and Forms panel) decides the calculation order for the field. The higher the number, the later the field is calculated.

For instance, if one field is called “Text Field 3” and another is called “Text Field 10”, and both have calculation scripts attached to them, the calculation script attached to Text Field 3 will be run before that of Text Field 10.

Note that the numbers do not need to be consecutive. They are simply sorted in ascending order, with the smaller numbers being calculated first, and the larger numbers later.

Tip: When adding numbers to the end of field names in InDesign, consider using multiples of 10 initially (e.g., Field 10, Field 20, Field 30, and so on). That way, if you ever need to insert an extra field to be calculated after Field 10 but before Field 20, you can add 15 to the end of its name. This will avoid having to renumber all other fields whenever you insert a new one.

4. Renaming Form Fields

In most cases, it is safe to rename form fields. Use InDesign’s Buttons and Forms panel to do so.

However, if you have used the Calculate options on any form fields, you will need to select those fields, click on FormMaker‘s Calculate tab, and update the fields that should be calculated again, because the existing list of fields will include references to the old names that no longer exist.

Likewise, if you have attached any custom scripts to any fields or to the document, and those scripts refer to form fields by name, those names will need to be updated in all such scripts.

5.   Advanced Topic: What Is the Difference Between the Types of Script?

With FormMaker you can add custom document-level scripts, and keystroke, formatting, validation and calculation scripts to your forms. What is the difference between these types of script?

The information in this section is not actually specific to FormMaker. It is a summary of the differences between the types of script available in Acrobat.

The main difference between the different types of script is when – at what stage of the user interacting with the PDF form – they are run.

Document scripts are triggered as soon as the user opens the PDF document in Acrobat Reader. They are commonly used for storing oft-repeated functions accessible by all form-field scripts. More interestingly, they can be used to set the PDF Reader application in ways not otherwise possible. For instance, if you dislike the blue background that Acrobat Reader displays by default behind all form fields, you can switch it off with a PDF document script!

Keystroke scripts are triggered when a field has focus and the user types something. Keystroke scripts are useful to prevent the user from typing certain letters, digits, or characters in a form field. For instance, for a number field, use a keystroke script to reject non-numeric keyboard input (keystrokes that are not digits, a period, or the hyphen used for a negative number). The Javascript command to reject a keypress is: event.rc = false. The command to accept a particular keypress is: event.rc = true. (FormMaker lets you create many scripts that filter keypresses without writing a line of code!)

In the case of combo boxes and dropdown lists, keystroke scripts are run when the selection changes in these items (even if this was not caused by a keypress).

Validation scripts are triggered when the value of a field changes. They can be used to check that the user has entered the correct sort of information in the field (e.g., a properly formatted date, email address, range, etc.). If a wrong value is entered, an alert box can be displayed. As with keystroke scripts, to reject the user input and revert to the previous value use this code: event.rc = false.

Calculation scripts are executed after validation scripts. The difference between validation and calculation scripts is that a validation script runs only when the value of the field it is attached to changes, whereas all calculation scripts, attached to any field in the document, are run whenever the value in any field changes. If you have 1000 calculation scripts in your form, they are all run whenever the value of any field changes! (As you might expect, this can take some time, so it may be best to use calculation scripts sparingly). The logic behind calculation scripts is that changing the value of one field could affect all other fields in the document if their content is based on a calculation that depends on the current field.

Format scripts are triggered last, after all keystroke, validation, and calculation scripts. Format scripts are useful for changing the appearance of a field’s value. For instance, use a format script to display 2 decimals places after a number, or to display a percentage sign or currency symbol in the field. Setting the value of an event (event.value = etc.) in a format script does not change the true value of the field, just the way it is displayed. (FormMaker lets you create many types of format script without writing a line of code!)

With FormMaker, you can attach keystroke, validation, calculation and formatting scripts to text fields, combo boxes, list boxes, checkboxes, buttons, and radio buttons in your InDesign forms (although not all types of scripts are available for all types of field in Acrobat).

The ability to include such scripts in InDesign makes it possible to build rich, interactive, fillable forms completely in InDesign and export them to PDF, thereby simplifying the form’s editorial and review cycle.

6. Further Reading and Useful Links

Although FormMaker lets you do a lot without needing to write any code, to make advanced interactive PDF forms, you probably will need to put together some simple (or not so simple) Acrobat JavaScripts. In this section I will list a few resources that I have found to be very useful.

  1. The complete reference for everything to do with Acrobat scripting is Adobe’s documentation. Here’s a link directly to the info about the all-important field object: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2FField.htm
  2. A good, basic introduction to PDF form scripting is this YouTube video by Thom Parker: https://www.youtube.com/watch?v=wySx6rhK-E4
  3. The Adobe Acrobat forum is a good place to ask Acrobat scripting questions: https://community.adobe.com/t5/acrobat/bd-p/acrobat
  4. And of course there is the Id-Extras.com forum as well: http://id-extras.com/forum/index.php

* * *

Questions, comments, or suggestions? Contact us or leave a message below!

Enjoy FormMaker!

Leave a Comment