Toggle menu

helper.utilLoadScript(fileName, cb)

A function used to dynamically load a third party JavaScript file.

This is also used by the form runtime to load jQuery and jQueryUI if not already present.

Executed

Client-side and server-side.

Arguments

ArgumentTypeDescription
fileNameString, requiredThe URL to the JavaScript file
cbFunction, optionalA function to execute after loading the file

Example

Included in a page init function this would make an additional JavaScript library available to your form.

function(helper, fieldName, value, valid, eventName) {
    helper.utilLoadScript("https://cdnjs.cloudflare.com/ajax/libs/chosen/1.6.2/chosen.jquery.min.js", function() {
        helper.setVariable("scriptLoaded", "OK");
    });
}

Last modified on March 06, 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon