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

Javascript Errors

New Here ,
Dec 11, 2018 Dec 11, 2018

My form was working perfectly until I added some script to hide fields based on a button... now I get an error

JavaScript Debugger (window) says:

TypeError:  f is null

1051:byteCodeTool

Any ideas?



   
 
 
 
 
 
 
 
 
 
 
 





TOPICS
Acrobat SDK and JavaScript , Windows
818
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

correct answers 1 Correct answer

LEGEND , Dec 11, 2018 Dec 11, 2018

In some code somewhere in the form, it's attempting to assign a field object to the variable f, for example:

var f = getField("Text1");

but the field ("Text1") does not exist. It could be that it was deleted or renamed. You're going to have to find the code and determine which field name it's using, and go from there.

Translate
Community Expert ,
Dec 11, 2018 Dec 11, 2018

Check the field names.

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
New Here ,
Dec 11, 2018 Dec 11, 2018

For what?  Please explain

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
New Here ,
Dec 11, 2018 Dec 11, 2018

form.png

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 ,
Dec 11, 2018 Dec 11, 2018

Compare the field names in your code with the field names in the form.

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
New Here ,
Dec 11, 2018 Dec 11, 2018

I wrote this for approx. 20 fields to hide when check box is
selected – naming all the fields starting with “Redo.”  It's the only one I have I think...

var nHide =
event.target.isBoxChecked(0)?display.visible:display.hidden;

  1. this.getField("Redo").display = nHide;

The only other one I have is a purchased cascade script from
MVP which appeared to be working fine prior to adding the above…

Both actually work but the Debugger error window keeps
coming up every time anything is slected?

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
New Here ,
Dec 11, 2018 Dec 11, 2018

I did delete a field that had script in it though... would that be causing the issue?

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 ,
Dec 11, 2018 Dec 11, 2018

Where did you set the variable f?

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
New Here ,
Dec 11, 2018 Dec 11, 2018

I'm not sure what that means?  ... but the issue appears to be in the cascade drop lists

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
LEGEND ,
Dec 11, 2018 Dec 11, 2018
LATEST

In some code somewhere in the form, it's attempting to assign a field object to the variable f, for example:

var f = getField("Text1");

but the field ("Text1") does not exist. It could be that it was deleted or renamed. You're going to have to find the code and determine which field name it's using, and go from there.

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