Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Variable functions are not recognized in Acrobat Reader DC

Avatar

Avatar
Level 1
pt20150922
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pt20150922
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
pt20150922
Level 1

22-09-2015

Using LiveCycle Designer ES4, I have created variable functions in JavaScript that I call in field events.  These functions work correctly in Adobe 11.  However, when tested in Acrobat Reader DC, these functions no longer work.  If I move the script from the function into the field event, the script works.  However, I do not want to stop using variables.  Many of these variables are long and used in many fields.  Does anyone have a fix for this issue?

Below is an example of one of the JavaScript variable functions currently being used in Adobe 11:

form1.#variables.EnterFieldFC - (JavaScript, client)

function EnterFieldFC(oField)

{

oField.border.edge.presence = "visible"

Field.border.edge.color.value = "255,0,0"

Field.borderWidth = "1.5";

}

Below is the call in the Enter field event:

EnterFieldFC.EnterFieldFC(this);

When the JavaScript Debugger is enabled in Acrobat Reader DC, an error message is displayed on entering the field stating that the function EnterFieldFC is unknown.

Accepted Solutions (0)

Answers (6)

Answers (6)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

22-09-2015

Ensure you set the scripting language in the fields enter Event to JavaScript!

If it's not, the script will fail because you cannot call JavaScript-script from a FormCalc-script and vice versa.

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 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,077 posts

Correct Reply

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

22-09-2015

Anything stupid could be the issue here...

Could it be because of the missing semi-colons at the end of the first 2 lines?

Try having a different name for your function or variable...

Otherwise some debugging is needed, use the try catch statement for livecycle, this could help a lot

Handling JavaScript Exceptions

Hope this will help!

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

22-09-2015

And what error message do you get?

Avatar

Avatar
Level 1
pt20150922
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pt20150922
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
pt20150922
Level 1

22-09-2015

So unfortunately, the issue still exists.

Avatar

Avatar
Level 1
pt20150922
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pt20150922
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
pt20150922
Level 1

22-09-2015

I am sorry for the typo.  oField is already used in all of the lines.  It must not have copied correctly.  So I took a screen shot instead.

821154_pastedImage_0.png

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

22-09-2015

In your script your using the parameter "Field" instead of "oField" as declared in the function head, that's why the function fails.

Correct the script into:


function EnterFieldFC(oField) {


  oField.border.edge.presence = "visible"


  oField.border.edge.color.value = "255,0,0"


  oField.borderWidth = "1.5";


}