Skip to main content
Known Participant
November 25, 2021
Question

Check Box adds info to email body

  • November 25, 2021
  • 2 replies
  • 332 views

Hello,

 

I would like to add information to an email depending on weather or not a check box has been ticked. I am able to do it with drop boxes but I am unsure of how to do it with tick boxes. I already have a variable called emailBody. the code I am trying to get work is bellow:

 

if (this.getField("Inductive"). valueAsString=="0")
emailBody += "\n700738197: Inductive Sensor";

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
November 27, 2021

You can read about check boxes and radio buttons here:

https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
November 27, 2021

When a check-box is not ticked its value is "Off". When it is ticked it's whatever export value it has.

You can also use the isBoxChecked method, which works independently of the export value.