At run time, if processing has been set to take place on the client, any scripts/calculations execute in real time on the user’s computer. The code and variables declared become available almost as soon as the form is opened. This information remains available, and the state of the data is maintained until one of these situations occurs:
LiveCycle Forms ES can manage any scripts/calculations that the client application cannot manage. For example, to prepopulate a form, you may have to use a script to connect to a database or web service that might not be available at the client. When LiveCycle Forms ES runs a script or calculation, the execution is done while the form is being rendered. No code or variables remain available after processing is completed. In other words, if you add variables to a script or calculation, they remain valid only for the duration of processing.
Note:
If you choose the HTML4 transformation to support Netscape Navigator 4.7.x, any JavaScript designated to run on the client is automatically run on the server instead.
See also 

Client- and server-side processing