Copy link to clipboard
Copied
Hi everyone,
I was creating a fill-in form with Acrobat, which would look great if I could circle a choice out of 4 items to pick from.
Excellent, Good, Poor, Fair.
I was able to use Mr. Karl Heinz Kremer code for circling Yes and No, which works perfectly.
Following this post here:
Circle something on a PDF just by clicking on it. (Create PDF)
Any assistance greatly appreciated.
Perhaps that great code can be modified to work with a choice of 4 items as apposed to 2.
I have no coding knowledge. Hence the question.
Thank you for your time and help in advance.
Sincerely,
Jerry
Sorry about the late reply. Somehow this question slipped by me.
In the case of four buttons, I would modify the code a bit to make it easier to turn the other buttons off. For this to work, you need to change the name of your four buttons from using a name prefix (e.g. "Button1") followed by a "_someOption" to using a period as the delimiter between the two parts of the name: "Button1.someOption". This allows us to treat all four buttons (or more, this solution is no longer limited by how many b
...Copy link to clipboard
Copied
Sorry about the late reply. Somehow this question slipped by me.
In the case of four buttons, I would modify the code a bit to make it easier to turn the other buttons off. For this to work, you need to change the name of your four buttons from using a name prefix (e.g. "Button1") followed by a "_someOption" to using a period as the delimiter between the two parts of the name: "Button1.someOption". This allows us to treat all four buttons (or more, this solution is no longer limited by how many buttons you want to group) as one - or to get all "children" of the "Button1" group of buttons. So, name your buttons e.g. "Button1.Opt1", "Button1.Opt2", "Button1.Opt3", and so on, and then use the following code as the button action in each button:
var baseName;
var currentState;
// get our name
var theName = event.target.name;
var re = /(.*)\.(.*)/;
var ar = re.exec(theName);
if (ar.length > 0) {
baseName = ar[1];
currentState = ar[2];
// make this button visible
event.target.buttonSetIcon(this.getField("icon").buttonGetIcon());
event.target.buttonPosition = position.iconOnly;
// hide the other button
var f_parent = this.getField(baseName);
var f = f_parent.getArray();
for (var i in f) {
if (f.name != theName) {
f.buttonPosition = position.textOnly;
}
}
}
Copy link to clipboard
Copied
Thank you so much Karl, I owe you. You are the man.
Can't wait to try it out, when I get back to my laptop.
Much grateful for your wonderful code and super kind helping hand.
Sincerely,
Jerry