Copy link to clipboard
Copied
I am creating a form that will post the results for certain test results on a building. Users will insert particular numbers (e.g., concentration of certain gases, etc.). If number meets acceptable standards (e.g., below acceptable maximum), then I would like a check box to turn on that says the building meets the safety standards.
let A = air quality value
let B = maximum accepted value
let C = checkbox indicating pass
So, if A < B, then C is ON (pass); if A > B, C is OFF (fail)
Copy link to clipboard
Copied
You can use the calculation event of a (hidden) text field to do it.
For example:
this.getField("C").checkThisBox(0, Number(this.getField("A").valueAsString)<Number(this.getField("B").valueAsString));
Please be very careful, though, as many PDF viewers will not execute this code and you could get false results, which in this case can even be dangerous!
Copy link to clipboard
Copied
Thanks for the input. Not sure I want to use a solution that isn't 100% reliable, though, since this form will be out "in the wild" where I can't control who's using it or where it's being distributed.
Copy link to clipboard
Copied
Then I recommend you don't use any automatic calculations. Let the users fill in everything themselves and be responsible for the outcome.