Copy link to clipboard
Copied
Hello,
I am working on a form. It has 5 checkboxes ( that signify an automatic fail) When I select any of these 5 checkboxes, I want a dropdown to automatically select Fail.
Checkbox names are Yes19 - 23
The Option is 3rd in the menu.
Does someone have any idea how to do this?
Also, I am taking some javascript courses, but do you have nay recommendations for other learning opportunities?
Copy link to clipboard
Copied
You can use this code as the custom calculation script of the drop-down:
var fail = false;
for (var i=19; i<=23; i++) {
if (this.getField("Yes"+i).valueAsString!="Off") {
fail = true;
break;
}
}
if (fail) event.value = "Fail";
General JS tutorial (note that only the core syntax applies to Acrobat): http://www.w3schools.com/js/default.asp
Homepage of the Acrobat SDK, including a link to the full API: http://www.adobe.com/devnet/acrobat.html
Free tutorials about Acrobat in general, including many JS related ones: https://acrobatusers.com/tutorials/
A paid-for website with tutorials about Acrobat JavaScript (not related to me): http://www.pdfscripting.com/
My own humble web-site with many tools for Acrobat and Reader (mostly paid-for, some free): http://www.try67.com
Copy link to clipboard
Copied
You can use this code as the custom calculation script of the drop-down:
var fail = false;
for (var i=19; i<=23; i++) {
if (this.getField("Yes"+i).valueAsString!="Off") {
fail = true;
break;
}
}
if (fail) event.value = "Fail";
General JS tutorial (note that only the core syntax applies to Acrobat): http://www.w3schools.com/js/default.asp
Homepage of the Acrobat SDK, including a link to the full API: http://www.adobe.com/devnet/acrobat.html
Free tutorials about Acrobat in general, including many JS related ones: https://acrobatusers.com/tutorials/
A paid-for website with tutorials about Acrobat JavaScript (not related to me): http://www.pdfscripting.com/
My own humble web-site with many tools for Acrobat and Reader (mostly paid-for, some free): http://www.try67.com
Copy link to clipboard
Copied
Thank you so much! I will also take a look at the tutorials you recommend!!