Calling JavaScript from a Form

Previous  Home topic  Next  Print this topic Send Feedback


An external JavaScript function can now be called by a behavior on a form or report. The form or report can be embedded in a Web page with the JavaScript code included in that Web page or DOM functions can also be used.


Note: When creating a function in JavaScript and invoking that function, you do not have to embed the form if you have an on-premise version. You can add the script to utils.js in the PerfectForms™ installed folder to have this work appropriately.


This opens new paths for integration. For example, the user can write a JavaScript function that uses makes AJAX calls to retrieve data from a server (using a proxy page). The form or report can then call this JavaScript function to indirectly retrieve this data from the server, instead of using PerfectForms™ built-in Connection features. You can also invoke browser functions directly as in the following example:




Instead of:

Function GetTextFieldName(fieldName){

                return document.getElementbyid (fieldName);



It is advisable that users be familiar with HTML and JavaScript concepts before attempting to integrate their forms and reports with Web page code. The World Wide Web Consortium contains extensive tutorials on the capabilities of JavaScript and JavaScript functions.


Note: To download this form, click here. Then to import the form log on to PerfectForms™, select the Forms Dashboard tab and click the Import button.



Updated: 5/10/2010  Page url:
PerfectForms™ -- forms software, workflow software, and business process management