PDF Editing Issues

Show Optional PDF Pages with a Radio Button in Adobe Acrobat

Rana GarciaRana Garcia Nov 24, 2026 868 views

Question details

Add an optional PDF page when a user selects a radio button.

Show Optional PDF Pages with a Radio Button in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form includes optional certification or information pages that should appear only when needed.
Observed behavior
Selecting a radio button should add the relevant optional page to the PDF.
Before you start

Open the PDF in Adobe Acrobat and prepare the optional page and radio button. Make sure JavaScript is enabled and note the exact name you assign to the page template.

Solution 1Recommended

Spawn a Page Template with a Radio Button Action

Use an Acrobat page template and a Mouse Up JavaScript action to add an optional page when the radio button is selected.

The action creates a page from a template; it does not reveal an existing hidden page. The example appends the new page to the end of the document.

1
Create the page template

Open Organize Pages and use the Page Templates option to create a template from the optional page. Give it a distinctive name, then hide the template if the page should not appear initially.

2
Open the radio button properties

Open Prepare a Form, select the radio button, and open its Properties dialog. Go to the Actions tab.

3
Add the JavaScript action

Select Mouse Up as the trigger and Run a JavaScript as the action, then click Add. Enter: var template = getTemplate("Template Name"); if (event.target.value != "Off") { template.spawn({nPage: numPages, bRename: false, bOverlay: false}); }

4
Save and test the form

Replace Template Name in the script with the exact template name, save the PDF, and use Preview or reopen the file to select the radio button. Check that the optional page appears at the end.

Spawn a Page Template with a Radio Button Action
Repeated selections and viewer support: This script can add another copy each time it runs; it does not remove a spawned page when the selection changes. Test the form in the intended PDF viewer, because JavaScript and template spawning may be restricted or unsupported.
Free Microsoft Office alternative

Work with PDF and Office Documents in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for working with PDFs and Office files. It can help you migrate everyday document work, but it does not replace Acrobat's page-template JavaScript workflow.

Open and review PDF documents alongside Office filesCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for a smoother transition from Microsoft OfficeAccess common document tools in a lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Where do I add the radio button script in Acrobat?

Open Prepare a Form, open the radio button's Properties, and select Actions. Choose Mouse Up and Run a JavaScript, then click Add.

Does the script reveal the original hidden page?

No. The script spawns a new page from the named template and appends it to the document.

Why does selecting the radio button add multiple pages?

The example spawns a page each time the action runs while the value is not Off. Preventing duplicates requires additional logic to check whether the page has already been added.

Will the form work in every PDF viewer?

Not necessarily. PDF viewers differ in their support for Acrobat JavaScript and template spawning. Test the saved form in the viewer your recipients will use.