Other PDF Issues

Fix JavaScript Errors in an Acrobat Dynamic Stamp

Maira MehtabMaira Mehtab Nov 19, 2026 868 views

Question details

Fix a custom dynamic stamp that should collect dates, names, revision data, and checkbox selections.

Fix JavaScript Errors in an Acrobat Dynamic Stamp
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.
Before you start

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.

Solution 1Recommended

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.

1
Inspect the error

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.

2
Correct the condition

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.

3
Check the field names

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.

4
Match checkbox and menu values

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.

5
Save and test the stamp

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.

Correct the stamp script and match its form field values
Editable fields require a form: If recipients must edit the information after the stamp is placed, add separate form fields to the destination PDF with Prepare a Form instead of relying on the applied stamp's flattened fields.
Free Microsoft Office alternative

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.

Open and annotate PDFs for document reviewCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for working across office documentsFree and lightweight alternative for everyday document tasks
microsoft office alternative - wps office

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.