Versions Compared

Key

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

...

Upload your custom JavaScript to  via the Scripts tab on the left menu inside your application. Follow these steps:

  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.

    Image Modified



  2. Login

    to 

     as

    as a

    designer

    user.

    Click

    the 

    Image Modified

     Edit

    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.  

  5. Clicking on the  Documentation icon brings you here.

  6. 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.

      

...

Here is an example of a snippet of code when added to the include.js will allow you to do something like this in a rule: DateControl?.value =MyUtil?.today();

Code Block
var MyUtil = {
    today: function() {
        var d = new Date();
        var dd = d.getDate();
        if (dd < 10) dd = '0' + dd;
        var mm = d.getMonth() + 1;
        if (mm < 10) mm = '0' + mm;
        var yyyy = d.getFullYear();
        return String(mm + "-" + dd + "-" + yyyy);
    }
}

...