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

Adobe stamp with Javascript form, check a checkbox !

New Here ,
May 29, 2024 May 29, 2024

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!

TOPICS
JavaScript , PDF forms
475
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 ,
May 29, 2024 May 29, 2024

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. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
May 29, 2024 May 29, 2024

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!

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 ,
May 29, 2024 May 29, 2024

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

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
Jun 06, 2024 Jun 06, 2024
LATEST

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

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