Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multi-option check boxes in a form

New Here ,
Jan 04, 2021 Jan 04, 2021

Hello!

 

How would I create a checkbox that: 

If clicked once, shows "checked"

If clicked twice, shows "strike through"

If clicked three times, shows blank

 

Please send over any tips, thanks!

 

TOPICS
PDF forms
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2021 Jan 04, 2021

A check-box can't do that. You can use a button field to do it, though, using a script. Try searching the forum for "tri-state field".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2021 Jan 05, 2021

I would consider a drop-down list

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2021 Jan 05, 2021

Here is a sample of a tri-state field: https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:b752bed2-3279-4360-aacb-00fb993eccf5


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2021 Jan 05, 2021

Hi JR,

I clicked on your link and it opened Document Cloud in the browser, but no document was visible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2021 Jan 05, 2021

Try a other browser.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2021 Jan 05, 2021

Using the browser you will only see a blank page with a white button with a green check, you must find the "Download" button and open it with Acrobat Pro.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2021 Jan 05, 2021

Here's a simple script for creating a 3-state button. Put it in the "MouseUp" action on the button. The font for the button needs to be set to a plain type 1 font, like Helvetica. The the button option to Label Only. 

You could also change the border and background properties with each click.

 

var strDash = "\u2014";
var strCheck = "\u2713";
var strVal = event.target.buttonGetCaption();
switch(strVal)
{
	case "":
	   event.target.buttonSetCaption(strCheck);
	   break;
	case strCheck:
	   event.target.buttonSetCaption(strDash);
	   break;
	case strDash:
	default:
	   event.target.buttonSetCaption("");
	   break;
}

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2024 Nov 06, 2024

hi, can this be adjusted to have 4 states?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2024 Nov 06, 2024

Absolutely, just add another case statement. 

 

var strDash = "\u2014";
var str4thState = "4";
var strVal = event.target.buttonGetCaption();
switch(strVal)
{
	case "":
	   event.target.buttonSetCaption(strCheck);
	   break;
	case strCheck:
	   event.target.buttonSetCaption(strDash);
	   break;
	case strDash:
	   event.target.buttonSetCaption(str4thState);
	   break;
	case str4thState:
	default:
	   event.target.buttonSetCaption("");
	   break;
}

 

 

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2024 Nov 06, 2024

Thank you! Super helpful, worked like a charm. However, does this button coding only work within Acrobat Pro specifically, or can other PDF readers (e.g. Preview on Mac, and whatever the default is on Windows) have this function too?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2024 Nov 07, 2024

No, because you need real PDF reader software, that supports JavaScript.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 26, 2025 Aug 26, 2025

I'm having trouble. Maybe a recent update has changed settings so I no longer have certain options. 

The cannot specify a particular font for the checkbox. I also cannot find the button option: "Label Only". See attached screenshotsScreen Shot 2025-08-26 at 7.29.03 AM.png

 

Screen Shot 2025-08-26 at 7.28.48 AM.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 26, 2025 Aug 26, 2025

These are options of a button field, not a check-box.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 26, 2025 Aug 26, 2025

That worked like a charm! Thank you.

Now, I have a second question. How do I edit the appearance of the 3-States?

1st Click= Filled Box

2nd Click= Diagonal Strike

3rd Click= Blank

The following is what I want it to look like:

Screen Shot 2025-08-26 at 12.35.01 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 26, 2025 Aug 26, 2025
LATEST

That will require using images, not just plain text, and is more complicated to implement.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines