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

Multi-option check boxes in a form

New Here ,
Jan 04, 2021 Jan 04, 2021

Copy link to clipboard

Copied

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

Views

1.6K

Translate

Translate

Report

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

Copy link to clipboard

Copied

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".

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

I would consider a drop-down list

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi JR,

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Try a other browser.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

hi, can this be adjusted to have 4 states?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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