Help with PDF JavaScript
Hi community,
I would like some help with some javascript ! The script I found helps me with marking circles over answers on a pdf that I have. However, I would like some help changing the code so that if I click on the button again, the circle disappears--to give people the option of selecting and deselecting. Any help much appreciated.
The code is below. Credit Source: http://khkonsulting.com/2016/11/mark-selected-options-with-circles-in-pdf-forms/#:~:text=On%20the%20%E2%80%9COptions%E2%80%9D%20tab%20select,select%20options%20on%20the%20form.
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[i].name != theName) {
f[i].buttonPosition = position.textOnly;
}
}
}
this.calculateNow();
