Here is what I want to do:
I have a CheckBox field and a Text field. If the checkbox is "checked" I want to populate the text field with a specific numeric value. If it is left "unchecked" there would be no value or 0 value. Any help is appreciated.
Copy link to clipboard
Enter this code as the custom calculation script of your text field:
event.value = this.getField("CheckBox1").value == "Off" ? 0 : 1234;
Perfect. Thank you.
I've used this code to do the same thing with a fillable form in Adobe Acrobat Pro DC. However, when I'm viewing the form in Acrobat Reader, the checkbox does the opposite of what it should. When it is unchecked, it populates a number in another field, and when checked, that other field is 0.
That should not be the case... Are you saying it's working well in Acrobat but not in Reader? Are you sure you're opening it in Reader and not in some other application, like inside a browser window?
I posted a similar question but found your answer and it worked. Thank you very much.