Where to Add a Custom Format Script in Acrobat PDF Forms
Question details
The user needs to know the correct location within Adobe Acrobat to input custom JavaScript that formats how a PDF form field displays its value.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or editing an interactive PDF form and applying custom display formatting to specific text fields.
- Observed behavior
- The user wants to ensure the script is placed in the proper properties tab so the formatting executes correctly without interfering with validation or actions.
Make sure you have your custom JavaScript code ready and ensure that your PDF form is opened in editing or 'Prepare Form' mode.
Add Custom JavaScript via the Field's Format Tab
Use this method to correctly apply display formatting to a text field without causing conflicts with validation or calculation scripts.
In Adobe Acrobat, form field properties are divided into specific tabs based on their function. To change how a value visually appears after a user enters it (such as adding currency symbols or specific date layouts), the JavaScript must be placed exclusively in the Format tab.
Open your PDF in Adobe Acrobat, go to 'Tools', and select 'Prepare Form' to enable form editing capabilities.
Right-click the specific text field you want to format and select 'Properties' from the context menu.
In the Text Field Properties dialog box, click on the 'Format' tab located at the top.
Click the 'Select format category' drop-down menu and choose 'Custom' from the list of options.
Locate the 'Custom Format Script' text box, click the 'Edit' button next to it, and paste your JavaScript code into the JavaScript Editor. Click 'OK' to save.

Edit and Fill PDF Forms Smoothly with WPS PDF
If you need a fast and reliable tool for handling interactive PDFs, WPS Office offers a powerful built-in PDF editor. It allows you to easily view, fill, and manage PDF forms with a highly intuitive interface.
- 1. Launch WPS Office: Open WPS Office on your computer and select the 'PDF' option from the main dashboard.
- 2. Open the PDF Form: Click 'Open' and browse your computer to select the PDF form document you need to work on.
- 3. Interact with Form Fields: Navigate to the form fields within the document; WPS PDF will automatically recognize fillable fields so you can type your data directly into them.
- 4. Save and Export: Once your form is filled or modified, click the 'Save' icon or export it to ensure all your form data is preserved securely.

Frequently Asked Questions
Why isn't my formatting script working when placed in the Actions tab?
The Actions tab is designed for event-triggered scripts, such as what happens when a user clicks or hovers over a field. Formatting scripts are meant to run automatically to change the visual presentation of data after input, which is why they only function correctly in the Format tab.
Can I use custom JavaScript for field validation instead of formatting?
Yes, you can use JavaScript for validation, but that code must be placed in the Validate tab. The Validate tab checks whether the user's input is acceptable before it is accepted, whereas the Format tab only changes how accepted data looks.
Do formatting scripts change the actual underlying data value of the field?
No, a format script only changes how the value is displayed on the screen or when printed. The underlying data value exported from the form remains exactly as the user entered it, unless it is specifically altered by a Calculation script.
What is the difference between a Calculation script and a Format script in PDF forms?
Calculation scripts determine the actual value of a field based on inputs from other fields (like a sum or total). Format scripts simply take that final calculated value and style it visually, such as adding a dollar sign or decimal points.




