Copy link to clipboard
Copied
I need to check a checkbox in my stamp, throught my form in Javascript.
I have tried all of this so far :
var f = this.getField("checkBoxStatus");
f.checked = true;
this.getField("checkBoxStatus"),value = “Yes”;
this.getField("checkBoxStatus"),value = “On”;
this.getField("checkBoxStatus").isBoxChecked(1);
this.getField("checkBoxStatus").checkThisBox(0,true);
It's my first time trying that so I'm looking throught Internet but I can't find the right way!
Thanks for your help!
Copy link to clipboard
Copied
So, there are several errors in the code. For exampel, there is no "checked" property, and there are syntax errors on the other lines.
But the first thing you need to do is read about creating dynamic stamps.
https://acrobatusers.com/tutorials/creating-a-custom-dynamic-stamp-infographic/index.html
https://acrobatusers.com/tutorials/dynamic_stamp_secrets/index.html
The first level of the UI in the articles is old, but everything else is correct.
Copy link to clipboard
Copied
Thanks Thom, I will check that out. I'm used to code in .net so it doesn't came to my mind that there is no checked property for a checkbox!
Copy link to clipboard
Copied
Well then, it's a good idea to look over the Acrobat JavaScript Reference. You'll find lots of important information here:
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/toc.html
And here's an article on now checkboxes work in Acrobat scripting:
https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm
Copy link to clipboard
Copied
Thanks for the link, I understand better. It's a bit complicate to explain what I need to do but I change for RadioButtonGroup to achieve what I need, by playing with display hideen/visible.
this.getField("myRadioButtonGroup").display = display.hidden
this.getField("myRadioButtonGroup").display = display.visible