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!
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".
Copy link to clipboard
Copied
I would consider a drop-down list
Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
Try a other browser.
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.
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;
}
Copy link to clipboard
Copied
hi, can this be adjusted to have 4 states?
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;
}
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?
Copy link to clipboard
Copied
No, because you need real PDF reader software, that supports JavaScript.