Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
9

PDF Form Checkboxes to select dropdown option

Community Beginner ,
Jan 12, 2024 Jan 12, 2024

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? 

 

 

TOPICS
How to , JavaScript , PDF forms
433
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jan 12, 2024 Jan 12, 2024

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

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 12, 2024 Jan 12, 2024

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 12, 2024 Jan 12, 2024
LATEST

Thank you so much!  I will also take a look at the tutorials you recommend!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines