Using !VALIDATING

 

 

 if (!VALIDATING) is included when displaying an alert or referencing Global JavaScript.  The code is validated by running it on the server.  The server does not have browser elements thus if the code references any browser elements the code needs to be blocked from executing during the validation.  An alert is a browser function and without the if (!VALIDATING) an error will occur.  When the code is actually run then the code within the if (!VALIDATING) will get executed. the code is run on the Preview tab and during data entry. 

 

For example:

if (!VALIDATING) alert("Please verify the value that was entered");

if (!VALIDATING) showVar(#MyCode.getControl(), #condition==1);

where showVar is a function defined in the Global JavaScript