Copy link to clipboard
Copied
I need to make a checkbox with three options. Checked, not checked, or a dash. I can sort of do this with a dropdown box, but was wondering if there was a way to do it with a checkbox.
Copy link to clipboard
Copied
Not with an actual check box, but you can fake it using a button. The following demo uses a button and text field combination. The button provides the UI and appearance, and the text field provides the means to get/set the value of what I call the composite field. It relies on JavaScript, so you'll have to study it to see how it works, and it won't work on most non-Adobe PDF viewers and most mobile PDF viewers.
Demo: http://www.acroscript.net/pdf/demos/multistate_4.pdf
Things can be simplified if you don't need to worry about getting/setting or importing/exporting the field value, but I don't have a demo for that.
Copy link to clipboard
Copied
Not with an actual check box, but you can fake it using a button. The following demo uses a button and text field combination. The button provides the UI and appearance, and the text field provides the means to get/set the value of what I call the composite field. It relies on JavaScript, so you'll have to study it to see how it works, and it won't work on most non-Adobe PDF viewers and most mobile PDF viewers.
Demo: http://www.acroscript.net/pdf/demos/multistate_4.pdf
Things can be simplified if you don't need to worry about getting/setting or importing/exporting the field value, but I don't have a demo for that.
Copy link to clipboard
Copied
The Multistate Checkbox is pretty much exactly what I need. I am nowhere an expert with Java though. Often I have found I can copy past just enough to get by. I copied both boxes and copied the script into "document Java Script" under "init" but the icons don't appear on my document. Also I need to change the X to a dash. Heavy Minus sign 2796 looks about right but I don't seem to be changing the entry correctly as it just stays an X.
Copy link to clipboard
Copied
If you're able to post your form somewhere and provide a link here, I'd be happy to take a look. If you can't, feel free to email me at: acroscript at gmail dot com
Copy link to clipboard
Copied
Thanks I sent you a copy of the PDF I am working with.
Copy link to clipboard
Copied
This is exactly what I need to do, but the PDF file listed in the answer is no longer available.
Can anyone help?
Thanks!
Copy link to clipboard
Copied
What exactly are you trying to achieve?
Here is script for button that will change on each click: blank, green checkmark, red dashes:
if (event.target.buttonGetCaption()=="\u2714") {
event.target.buttonSetCaption("---");
event.target.textColor = color.red;
} else if (event.target.buttonGetCaption()=="---") {
event.target.buttonSetCaption("");
} else if (event.target.buttonGetCaption()=="") {
event.target.buttonSetCaption("\u2714");
event.target.textColor = color.green;
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more