Skip to main content
Participant
Apr 23, 2025 4:55 PM UTC
Question

Check Box Returns Value

Hello,

Need help! I am new to PDF forms and writing JavaScript.

I have a Checkbox that, when checked I want it to return "2 Weeks" in a Text Box (titled "Lead Time") and when unchecked it will return "8 Weeks" in the same Text Box.

 

Secondly, when that same Checkbox is checked, in another Text Box (titled "ExpediteCost"), a formula will take the Text Box titled "Cost"  and multiply by 10% and show the value in the "ExpediteCost" Text Box.  When the Checkbox is unchecked, the "ExpediteCost" Text Box will be blank or say "N/A".

 

Any help is greatly appreciated!

4 replies

JR Boulay
Community Expert
Community Expert
Apr 27, 2025 8:16 PM UTC

[MOVED TO THE ACROBAT DISCUSSIONS]

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Apr 23, 2025 7:08 PM UTC

What's the name of the check-box field?

Translate
Participant
Apr 23, 2025 7:22 PM UTC

"ExpediteDrawing"

Translate
try67
Community Expert
Community Expert
Apr 23, 2025 10:45 PM UTC

Calc. script for "Lead Time":

 

if (this.getField("ExpediteDrawing").valueAsString=="Off") event.value = "8 Weeks";
else event.value = "2 Weeks";

 

Calc. script for "ExpediteCost":

 

if (this.getField("ExpediteDrawing").valueAsString=="Off") event.value = "";
else event.value = Number(this.getField("Cost").valueAsString) * 0.1;

Translate