Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Why checkboxes affect custom calculation scripts

Explorer ,
Sep 13, 2022 Sep 13, 2022

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.

TOPICS
How to , JavaScript , PDF forms
3.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Explorer ,
Sep 20, 2022 Sep 20, 2022
LATEST

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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 13, 2022

Check the field calculation order.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 13, 2022

No matter what calculation order I set, this happens.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 13, 2022

Can you share (part of) this form?


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 13, 2022

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 13, 2022

No not allways,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 13, 2022

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 13, 2022

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 13, 2022

You are right. The value I entered in Script_test is in format 1/3 and 30/11.

But the same behaivor of my form I got with entered date in format 01.03.2022 and 30.11.2022 and five checkboxes. I am in dark.  I am trying to find error in my script with no luck. That is why I am asking for help here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 14, 2022 Sep 14, 2022

"The value I entered in Script_test is in format 1/3 and 30/11."

May be that the script fails with this values.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 14, 2022 Sep 14, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 20, 2022 Sep 20, 2022
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines