dynamic form docready referenceerror




I have a dynamic form that I have built using Designer as part of LC ES3.  It has a lot of complex dynamic forms and complex exclusion groups, which get triggered when the form is starting up.  This causes the form to take some time to load.  In order to disable the exclusion group calculation field from being triggered during start up (as it isn't needed at that time as form validation is done when the user clicks a button) I have created a form variable called formStartingUp and on the root node initialise event I set the formStartingUp.value = "true".  In the docReady event I set the formStartingUp.value = "false".  The exclusion group function is then only allowed to run when the formStartingUp.value == "false".

Now this does work and makes a massive time saving, 10+ seconds on start up, and this isn't the problem (although I will welcome any thoughts on a better way to do it).  The actual problem is this: when the form is rendered it displays a yellow banner across the top of the form saying: "Data from this site is blocked to avoid potential security risks. If you trust this document..." and I have an option to trust the document.  When I trust it, the form is reloaded.

However when I check the form and run the validation, the exclusion group functionality isn't being run.  When I check the console I get a ReferenceError: formStartingUp is undefined error message.

I have been trawling the forum's hoping that someone else has had a similar issue with no joy, so I thought I would ask here and see if someone can help.  Unfortunately I can't post the form as it is confidential.

I have hand typed these parts:

application_form::initialise - (Javascript, client)

formStartingUp.value = "true";

console.println("starting up: "+formStartingUp.value);

application_form::docReady - (Javascript, cleint)

formStartingUp.value = "false";

console.println("staring up: "+formStartingUp.value);

application_form.sChanges::calculate - (Javascript, client)

if ( formStartingUp.value == "false)


This works in a standard form, but failse on the docReady.

Any thoughts on how to get this to work would be much appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)



I will not comment about the performance aspect, since I've limited visibility about rest of your scripting.

However if you get that yellow trust bar while opening the form in Adobe reader, it means that either your form is accessing some data from a data connection to a remote server, or the form itself is downloaded from some remote server.

You could place cross domain file on the server (since i assume you will not have a control of all client machines to have them trust a host in advance).

check out page 11 on this document : https://www.adobe.com/devnet-docs/acrobatetk/tools/AppSec/Acrobat_Enhanced_Security_FAQ.pdf

If your problem appears similar, your business case most likely falls under the "Case C".

Additionally could you try moving your defining script i.e. formStartingUp.value = "true"   from initialize event to the docReady event.

and the script that validates the values later on could be moved to layoutReady.

It seems that the initialization is not happening again, and that's why the formStartingUp is not initialized with its default value.