Fix JavaScript Errors in an Acrobat Dynamic Stamp
Question details
Fix a custom dynamic stamp that should collect dates, names, revision data, and checkbox selections.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- The user applies a custom PDF stamp and wants to enter information and select a review status.
- Observed behavior
- The stamp script produces errors, and the applied stamp does not provide editable fields.
Open the custom stamp's PDF template in Acrobat and identify its form fields and internal stamp name. Check the error message in Acrobat's JavaScript console before changing the script.
Correct the stamp script and match its form field values
Use this approach when the dynamic stamp script fails or assigns values to the wrong fields.
Dynamic stamp scripts can prompt for values and populate existing fields in the stamp template. The resulting stamp is generally flattened when applied, so its template fields do not become editable form fields in the destination PDF.
Open Acrobat's JavaScript console using Ctrl+J on Windows or Command+J on macOS, then apply the stamp and review the reported error and line number.
In the stamp template, open the field's Properties, select Calculate, and edit its custom calculation script. Ensure the condition has both closing parentheses, for example: if ((event.source.forReal) && (event.source.stampName == "ABC")) { ... }. Replace ABC with the stamp's actual internal name.
Open Prepare a Form in the stamp template and compare the exact field names with each this.getField("...") reference. For example, use the actual names of the date, name, revision, and checkbox fields.
In each checkbox's Properties, check its export value and use that value when selecting it; use "Off" to clear it. In the script, make each comparison match the corresponding app.popUpMenu option exactly, including punctuation and spelling.
Save the stamp template, then select the custom stamp from Acrobat's Stamp tool and apply it to a test PDF. Respond to the prompts and verify the date, name, revision, and selected status.

Review and Annotate PDFs with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for opening documents and reviewing PDFs. It supports common Microsoft Office formats for a straightforward move between applications, but it does not fix Acrobat dynamic stamp JavaScript.

Frequently Asked Questions
Why does Acrobat report a syntax error in the stamp condition?
Check that the if condition closes both the stamp-name comparison and the outer condition. For example: if ((event.source.forReal) && (event.source.stampName == "ABC")) { ... }.
Why does the selected review status not check a box?
Compare the app.popUpMenu option with the string in the corresponding if statement. For example, "Revise and Resubmit" does not match "Revise & Resubmit". Also check the checkbox's export value in its Properties.
How do I find the names used by the stamp script?
Open the stamp PDF template and select Prepare a Form to inspect its field names. Each name must match the corresponding this.getField("...") reference exactly.
Can someone edit the fields after I apply the stamp?
The applied stamp is generally flattened, so its template fields are not editable in the destination PDF. Use Acrobat's Prepare a Form tool to add separate editable fields if recipients need to change the information.




