Skip to main content
Inspiring
September 13, 2022
Answered

Why checkboxes affect custom calculation scripts

  • September 13, 2022
  • 4 replies
  • 4610 views

I have custom calculation scripts in adobe fillable forms. Everything was working fine until I placed checkboxes in the form. Now two of the custom calculation scripts show the default value when I check the checkbox. This happens randomly, and not always, no matter which checkbox I check.
What did I do wrong to make this happen?
Im asking for help.

This topic has been closed for replies.
Correct answer SteniSlo

The basis for the calculation script "ns1" is the excel formula in cell F21 and "ns2" in cell F22, in the attached file. Since the formula in Excel works flawlessly, I translated it into a calculation script. Since the debugger did not report any errors, I assumed that everything was OK with the script. But it isn't.
There is an error in the script, but I can't find it.
Any help is welcome.


After several days of searching for errors in the script, I finally succeeded. I have a fully working script. Thanks to everyone who pointed me in the right direction and helped me find a solution.

Mainly the brackets were missing, I changed some scripts in the text boxes and used them as a function. And I succeeded.

4 replies

JR Boulay
Community Expert
Community Expert
September 13, 2022

Indeed, it is bugging somewhere.

But there are too many calculations and scripts for me to help you quickly.

You need to check all your scripts and all your calculations until you isolate the culprit.

Acrobate du PDF, InDesigner et Photoshopographe
SteniSloAuthor
Inspiring
September 13, 2022

For testing I made this file, which has only to calculation scripts. Without checkbox scripts are workin as it should, but with checkbox not. Test I was made with 01.03.2022 and 30.11.2022. Corect result is in "ns1" = 60 and in "ns2" = 47.

Debugger don't show error. But I don't find what is wrong in script.

Bernd Alheit
Community Expert
Community Expert
September 13, 2022

When I mouse click in the fields "zacetek" and "konec" I see wrong values.

JR Boulay
Community Expert
Community Expert
September 13, 2022

I can't reproduce this isue.

I checked and unchecked all the checkboxes after filling in the Date fields: it does not change the NS1 and NS2 fields.

Acrobate du PDF, InDesigner et Photoshopographe
SteniSloAuthor
Inspiring
September 13, 2022

put in "zacetek" 01.03.2022 and in "konec" 30.11.2022

JR Boulay
Community Expert
Community Expert
September 13, 2022

Can you share (part of) this form?

Acrobate du PDF, InDesigner et Photoshopographe
SteniSloAuthor
Inspiring
September 13, 2022

When I enter date in form field "zacetek" and in form field "konec" it should calculate "dni_najem" and "ns1", "ns2", "ss1", "ss2", "vs". This is needed for calculation in "dniNs", "dniSs" and "dniVs".

But when I check checkbox the value in "ns1", "ns2"  sometimes change.

Bernd Alheit
Community Expert
Community Expert
September 13, 2022

The fields  "ns1" and "ns2"  shows always the value 0-

Bernd Alheit
Community Expert
Community Expert
September 13, 2022

Check the field calculation order.

SteniSloAuthor
Inspiring
September 13, 2022

No matter what calculation order I set, this happens.