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

calculations with JS fail and other fault indications

Community Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Hello everyone!

 

I’ve designed a serious game, realized as an interactive pdf file with numerous formular fields, buttons and functions. Now I need your help please. The following fault indications were given by the JS-Debugger:


TypeError: getField(...) is null

2:Field:Calculate

TypeError: getField(...) is null

2:Field:Calculate

TypeError: f is null

1282:byteCodeTool

TypeError: f is null

1282:byteCodeTool

TypeError: f is null

1282:byteCodeTool

TypeError: f is null

1282:byteCodeTool

 

May I upload the data and you’ll check it?

 

More explanations about the problem:

 

In the game often points have to be added or subtracted. Several times an action of one check box influences changes on several other pages. E.g: on page 128, 142 and 148 in invisible work buttons different points for different categories are calculated.  

The score is always shown on the bottom and on a score card, that is linked with buttons on most pages.

After deleting all fillings, with the unvisible “Testbutton” on page 364 the score of economy and time quota should be 10 and the others 0 as a starting score. It all used to work but now it’s not working anymore. This fault message is given:

 

TypeError: getField(...) is null

2:Field:Calculate

TypeError: getField(...) is null

2:Field:Calculate

TypeError: f is null

1282:byteCodeTool

TypeError: f is null

1282:byteCodeTool

TypeError: f is null

1282:byteCodeTool

TypeError: f is null

1282:byteCodeTool

 

The calculation for the categories ecology and social works. But even there the same fault message ist given. I don’t understand it because it doesn’t show where the fault occures.

The addition and subtraction is made by the standard addition. With it each field/score is added and not the groupname. By this I reduce the likeliness for for faults when I take out several actions/tasks in between.

 

Each single addition is done by small JS e.g. page 148:
var a = +getField("PtsDecSoz.10").value;

if (a>0)

event.value = -2;

else event.value = "";

 

PtsDecSoz.10 is the name of the third checkbox from the top. The addition happens iin the field PtsDeEoExt.36.

 

In an older version of the game I usually had the problem, that additions with several steps haven’t been completed by the JS. That’s why the command this.calculateNow(); was included in the JS.

 

Finally, I’ve got one question concerning the lists, e.g. p. 145.

The instruction sais, that answer option with several “yes” can be activated.

It works but then the export value is 0. Even though the answers had another score and should be added. Is there a JS for it that makes it possible to add the scores of a question with several correct answers?

This last question is less urgent than the problems above.

 

Since we’ve already lost a lot of time finding the solutions for the problems, I’m looking forward to your response.

 

Thank you a lot.

 

Greetings,

Antonia

 

TOPICS
JavaScript , PDF forms

Views

970

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 ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Sure, share the file and we'll look into it.

Votes

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 Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Hi, thanks for the quick response. Here it is.

The document contains copy rights. So no sharing elsewere please. 

 

[File deleted at user request. If the file needs to be shared for people to help you, use something like Dropbox or Document Cloud to store it with a sharing link that can be removed later and email the link to those who say they think they can help.]

Votes

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 ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

This is a public forum. If you share it here anyone will be able to access it.

Votes

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 ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

I'm seeing error messages about "Review.19", which doesn't exist, and about "PtsDecEco.43", which also doesn't exist... You need to carefully review your code and look for such instances and then solve them, one by one.

Votes

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 Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Ok. Thank you. So do I have to make sure that eg. Review.19 exists if they're refered to!? I had checked such mistakes before Wondering why they were not shown in my JS debugger

Votes

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 ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

quote

Ok. Thank you. So do I have to make sure that eg. Review.19 exists if they're refered to!? I had checked such mistakes before Wondering why they were not shown in my JS debugger


By @Antonia98A7

 

Well, yes, if you're referring to a field in your code and then doing something with it then you have to make sure it exists, or it will throw a NullPointerException error.

These errors are shown in the JS Console, but in Acrobat DC it doesn't always list the actual name of the field that's missing, or the one that triggered the script, which makes it very difficult to locate the error.

Votes

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 Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Whith which tool can I review these faults in the code / the whole code? The JavaScript Debugger still doesn't help me. 

Votes

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 Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

OK. is it possible to delete it now? Can't find a delete button here

Votes

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 Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

I mean the file

Votes

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
LEGEND ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Go to your post. Click Report under it. Describe your problem. A moderator who sees your request may eventually remove the file. In general, realise that this is how public forums must work!

Votes

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 Beginner ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Thank you. Done. I've read the rules before, but didn't see anything about that. Of course the discussion should stay to help others too, but I wasn't informed that I can't delete the file after a few days. 

 

Votes

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 ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

PS. Your file changed my fields' highlighting color (to an annoying grey) without informing me of this change! That is super-annoying and intrusive. You should NOT do that without at least letting the users know you did it, and better yet, get their permission to do so.

Votes

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 Beginner ,
Aug 11, 2021 Aug 11, 2021

Copy link to clipboard

Copied

LATEST

Oh, thanks for informing me. I'll check it out. Didn't include any setting like that. 

Votes

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