javascript variable not recognized

Avatar

Avatar
Validate 1
Level 2
ulibaehr
Level 2

Likes

2 likes

Total Posts

71 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
ulibaehr
Level 2

Likes

2 likes

Total Posts

71 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Boost 1
Affirm 3
Affirm 1
View profile
ulibaehr
Level 2

26-04-2018

In a click event I got this code (stripped down to the basics):

var i = 0;

var x = 0;

var y = 0;

var arrayAnswers = new Array;

for (i= 0; i < tableSource._row.count; i++)

{

    for (x=0; x < arrayAnswers.length; x++)

    {   

        y++;

    }

}

That works fine with most Adobe Readers.

But the customer has a version that always returns the (German) error message;

Acrobat – Version mit integrierten EScript-Funktionen 11.0 Acrobat SOAP 11.0

GeneralError: Vorgang fehlgeschlagen.

  1. XFAObject.x:2:XFA:Formular1[0]:Seite1[0]:Übertrag[0]:click

Unterschiedliche Argumente im Eigenschaft- oder Funktionsargument

[Translates to: Varying arguments in function argument.]

We resolved this by simply renaming the variables to iInputTab, xOutputTab, yOutputTab

The it also worked at the customer's.

Has anyone ever come across an effect like that?

Any explanations?

I'd love to know what to look out for in the future.

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

26-04-2018

Hi,

The code in the click event runs with the this property set to the XFA button object, so a variable reference of x will refer to button.x as in the buttons x position.  I'm a bit surprised this works for anyone, there's a whole lot of XFA reserved names which I have slowly learned to avoid, like desc, id, index, items, name, nodes, parent, value, x, y, ...

Bruce

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

26-04-2018

Hi there,

at first sight, I would say that you forgot the parentheses when creating the Array

Otherwise.. I have no idea...

I hope this will help!