PDF Editing Issues

Make PDF Form Fields Required Based on Rent or Own in Adobe Acrobat

Olivia MillerOlivia Miller Nov 18, 2026 871 views

Question details

The form author needs fields to become required when a user selects Rent or Own and wants to know which control and script to use.

Make PDF Form Fields Required Based on Rent or Own in Adobe Acrobat
Product
Adobe Acrobat Pro PDF forms
Device & OS
not provided
Scenario
A PDF form records a Rent or Own choice and requires additional fields when either option is selected.
Observed behavior
The target fields should be marked required for form submission when Rent or Own is selected, and not required for other choices.
Before you start

Open the PDF in Adobe Acrobat Pro and choose All tools > Prepare a form. Check the exact field names and ensure the PDF viewer used for testing supports Acrobat form JavaScript.

Solution 1Recommended

Use a radio-button choice and a Mouse Up script

Use this method when Rent and Own must be separate, mutually exclusive choices.

1
Create the choice group

In All tools > Prepare a form, add radio buttons for Rent and Own. Give both buttons the same group name, such as HousingChoice, and set their export values to Rent and Own in their Properties.

2
Check the target field names

In Prepare a form, open Properties for each field that should become required. Note its exact name and replace text1, text2, and text3 in the script with those names.

3
Add the script to each button

Open Properties > Actions for each radio button. Select Mouse Up as the trigger and Run a JavaScript as the action, click Add, and paste the same script for each button: (function () { var fields = ["text1", "text2", "text3"]; var choice = this.getField("HousingChoice").value; var required = choice === "Rent" || choice === "Own"; for (var i = 0; i < fields.length; i += 1) { this.getField(fields[i]).required = required; } })();

4
Test the form

Use Preview in Prepare a form, select Rent and then Own, and test submission with the target fields empty and completed. If the group includes another choice, test that it clears the required setting.

Use a radio-button choice and a Mouse Up script
Required applies to submission: The required property is checked when the form is submitted; it does not by itself prevent saving, closing, or printing. JavaScript and form-submission support vary by PDF viewer.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for working with PDFs and migrating everyday documents. Use Acrobat or another compatible PDF form editor for the conditional JavaScript described above.

Open and review PDF forms alongside other documentsCompatible with Microsoft Office formats including DOCX, XLSX, and PPTXFamiliar editing tools make it easier to move existing Office files to WPSLightweight suite with free tools for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Should I use radio buttons or a checkbox for Rent and Own?

Use radio buttons with the same group name if users must choose Rent or Own. Use a single checkbox if the form only needs to know whether either condition applies.

Where do I put the conditional required-field script?

In Acrobat Pro, open All tools > Prepare a form, then open the choice control's Properties > Actions. Select Mouse Up and Run a JavaScript, and add the script. For a radio group, add it to each relevant button.

Why are empty required fields still saved or printed?

The required property is intended for form submission. It does not automatically block saving, closing, or printing the PDF.

Will the script work in every PDF viewer?

No. PDF viewers differ in their support for Acrobat form JavaScript and form submission. Test the completed form in the viewer your respondents will use.

How do I make more than three fields required?

Add their exact field names to the fields array in the script, separated by commas. The loop applies the same required setting to every listed field.