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

Javascript Errors

New Here ,
Dec 11, 2018 Dec 11, 2018

Copy link to clipboard

Copied

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

Views

700

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

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.

Votes

Translate

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

Copy link to clipboard

Copied

Check the field names.

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

Copy link to clipboard

Copied

For what?  Please explain

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

Copy link to clipboard

Copied

form.png

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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?

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

Where did you set the variable f?

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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.

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