Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Method 1 -  Add JavaScript to the custom.js file then upload it into your application.
  2. Method 2 -  Add a Message Control that contains your JavaScript.
  3.  Method 3 - Add JavaScript to the include.js file located inside the frevvo war.

...

  1. Your custom JavaScript must contain the comment // frevvo custom JavaScript as the first line of the file or the upload will not be successful. Here is an example of code that will add dashes to a Social Security number control as the user is typing it in. See Custom JavaScript Examples for information on this sample code. Notice the JavaScript comment is the first line in the script file.



  2. Login to  as a designer user. Click the Edit icon for the application where you want to use the JavaScript. Click on the Script tab located on the left menu.



  3. Browse your hard drive for you script file, Click Upload. Your file will be uploaded and it will display with the name Custom Script even though your script file may have another name. Be Aware that existing JavaScript files will be overwritten...

  4. If you need to modify the script, you must download it, make your modifications and then upload it again. When you download the script by clicking on the   Download icon, it will be named custom.js.  Clicking on the Image Removed Documentation icon brings you here.

  5. Once you have uploaded the JavaScript, it is available for all forms/flows in the application. Remember to add the CSS class name to your form controls or your JavaScript may not work. Here is an image of an Employee Information form using an uploaded JavaScript to enter dashes in the Social Security Number field while the user is entering the data.



    Tip

    If your JavaScript does not behave as expected after upgrading your version of , it may be caused by a scrubbing of the custom.js file content by XSS protection. You may notice that all your code is on a single commented out line upon Inspection of the custom.js file, Upload an "unsrubbed" version of your custom.js file to solve the issue.

...

Follow these steps to add JavaScript to your form using the Message control:

  1. Add a message control to your form. When you click on the message control, the Rich Text Editor displays.Click the Image Removed icon to display the Rich Text editor menus. Click the Source tab.
  2. Add a <script> tag in the message property. 
  3. Put your JavaScript inside the script tag.
  4. Click another control in your form to exit the Message control.
  5. Save your form.

Here is an example of the script tag: put your JavaScript inside the script tag.

...