


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.
Views
Replies
Sign in to like this content
Total Likes
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";
}
Views
Replies
Sign in to like this content
Total Likes
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.
Views
Replies
Sign in to like this content
Total Likes
So unfortunately, the issue still exists.
Views
Replies
Sign in to like this content
Total Likes
And what error message do you get?
Views
Replies
Sign in to like this content
Total Likes
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!
Views
Replies
Sign in to like this content
Total Likes
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.
Views
Replies
Sign in to like this content
Total Likes