Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Variable functions are not recognized in Acrobat Reader DC

Avatar

Level 1

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.

6 Replies

Avatar

Level 10

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";


}


Avatar

Level 1

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

Level 1

So unfortunately, the issue still exists.

Avatar

Level 10

And what error message do you get?

Avatar

Level 10

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

Level 10

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.