Skip to main content
Known Participant
March 14, 2025
Question

Creating a Button to Flag Required Radio Buttons

  • March 14, 2025
  • 1 reply
  • 2295 views

I am creating a form for a design company; there are several radio buttons that are required for submission. I want to create a button that when clicked, shows nothing if all required radio buttons are selected. If required radio buttons have not been selected, I want a pop up stating "Please select all required radio buttons" to appear. I have searched forums for days and nothing seems to be working properly.

1 reply

Thom Parker
Community Expert
Community Expert
March 14, 2025

Radio button groups (and check boxes) have a value of "Off" when unselected.  For example, if one of the radio button groups is named "Group1", then this code (on a button) could be used to validate a selection.

 

if(this.getField("Group1").value == "Off")

     app.alert("Please select an entry for the Group 1 Radio Buttons");

 

You can read more about radio buttons and checkboxes here:

https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Known Participant
March 14, 2025

That didn't work. The radio grouping is Group3.

 

try67
Community Expert
Community Expert
March 19, 2025

I want the button to check for all require fields, whether it is a text box or a radio button, and have the app alert pop up if any of them have not been filled out or completed


- The code in this file is not the code you posted here.

- You did not adjust the code as I've recommended in reply to your other post.

- You have an (at least one) incorrect field name in your code, namely: "Original Install_af_date"