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

Why checkboxes affect custom calculation scripts

Explorer ,
Sep 13, 2022 Sep 13, 2022

Copy link to clipboard

Copied

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

Views

158

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

Explorer , Sep 20, 2022 Sep 20, 2022

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.

Likes

Translate

Translate
Community Expert ,
Sep 13, 2022 Sep 13, 2022

Copy link to clipboard

Copied

Check the field calculation order.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

No matter what calculation order I set, this happens.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Can you share (part of) this form?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

No not allways,

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

May be that the script fails with this values.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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