Skip to main content
New Participant
July 9, 2013
Answered

How can you make check boxes select one only?

  • July 9, 2013
  • 7 replies
  • 191816 views

I am working on locking down a registration form. There are a couple sections that have multiple checkboxes but ONLY one can be marked. We won't even accept the form if there is more than one option marked. Most sections there are two boxes, check one but not the other. There is one section though that has 16 boxes, and yes only one can be marked.  Can I do that?

Similarly I also need to do the same thing with two text fields, only one should be filled out.

THANKS!

Correct answer Thom Parker

1)  Give all the check boxes the same name. 

2)  Make the export value (on the Options tab of the properties dialog) different for each.

7 replies

New Participant
September 23, 2025

You can do this in Adobe Acrobat forms (AcroForms) — checkboxes can be grouped so they behave like radio buttons. By default, checkboxes allow multiple selections, but if you give several checkboxes the same field name and different export values, Acrobat will automatically restrict the group to a single selection (just like radio buttons).

New Participant
August 20, 2024

Did you try using the Radio Button?

 

The Radio Button will make it a Choice. Where they must pick one of the options. 

Very Simple and no writing code. 

jattap32631833
New Participant
January 17, 2023

Hi! 

 

Is there any way of doing this already in InDesign?

Thom Parker
Adobe Expert
January 17, 2023

There are a number of issues covered in this thread. Which one do you want to do in InDesign?  

But just as a general rule, I don't think you can enter a PDF script in InDesign.  So any scripted solution would need to be entered in Acrobat. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
jattap32631833
New Participant
January 18, 2023

Ok, thanks! I was referring to the original question about the check boxes. I'm designing the forms in Indesing and was wondering if there is a way to do this in the "buttons and forms" menu. But apparently not. I'll make the changes in Acrobat afterwards. 

New Participant
August 12, 2021

The original answer for this has disappeared. How can you make sure just one checkbox is clicked? I can't find information about this anywhere else. 

Thom Parker
Adobe Expert
August 12, 2021

This question is so popular that it has two pages. You'll find all the previous posts on the first page.  Look at the bottom of this web page, you'll see the page controls, "Previous", "1", "2", and "Next".

 

However, it would probably be very helpful for you to read this article.

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

 

The technique is very simple if you want just one checkbox to be active at a time. But if you want some fancy combination, such as allowing any 3 checkboxes in a group, then a script is required.

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
New Participant
August 14, 2019

I'm not able to uncheck the box again like other regular checkboxes that don't have the check one option. Do you guys have a solution to this?

try67
Adobe Expert
August 14, 2019

Then it's most likely a radio-button, not a check-box.

brigittes62919937
New Participant
May 22, 2018

It's easy with check-boxes: Give them the same name but different export

values.

different export values

How?

brigittes62919937
New Participant
May 22, 2018

DW! I found how to set different export values

Properties > Options > Export Values

New Participant
March 10, 2020

Hi All, I see where I can change the export value in options, but it's not working for me. I have a ton of check boxes, but in groups. For example the first group of checkboxes are Emergency, Urgent, Priority, so I renamed each box "priority", then changed the export value from on to off. It didn't work; what am I missing? Thanks in advance for your help. 

try67
Adobe Expert
July 9, 2013

It's easy with check-boxes: Give them the same name but different export

values.

Not so simple with text fields... You'll need to figure out how you want it

to work. Should the other fields be locked when one field is filled-in, and

then unlocked when it's made empty again? Should they all remain editable,

but if you fill one of them the others reset?

All of this will have to be achieved with scripts.

New Participant
July 15, 2021

Hi,

I would like to limit the selection of tick boxes to only 3. I tried the below and it's now limited to only 1 selection. how do i make this 3 instead of 1?

1)  Give all the check boxes the same name. 

2)  Make the export value (on the Options tab of the properties dialog) different for each.

 

This is the list fo check boxes I have with tick boxes infront of each:

Main Contractor
Consultant
Sub-contractor
Developer
MEP Contractor
Project Management
Engineering

appreciate your help 

Thom Parker
Adobe Expert
July 19, 2021

Setting up multiple check boxes to select a set number is a completely different issue that requires a script. The script needs to count the number of active checks and then uncheck the last one if it goes over. There are several ways to create a solution but the easiest is to use a MouseUp script

 

First,  Give all checkboxes unique name, but put them in the same field group.

For example. Name them like this "Check.Box1" "Check.Box2", etc.  

In this case the group name is "Check".  The exports can be whatever you want. I'd suggest keeping the unique export names.

 

Second, Add this script to the MouseUp on each checkbox

 

var nMax = 3;
if(event.target.value != "Off")
{
	var nCnt = 0;
	this.getField("Check").getArray().forEach(function(a){if(a.value != "Off") nCnt++;});
	if(nCnt > nMax)
		event.target.value = "Off";
}

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often