Toggle menu

The Form Helper Library

The form helper library is a collection of over one hundred and fifty JavaScript functions you can use in your forms. They cover everything from showing and hiding fields to calling services on the API Server.

Helper functions are available to your form in handlers, default functions, when performing validation, in script actions and in buttons (ie anywhere you can write JavaScript). The library is also used in the skeletons that build the field types themselves.

You can find detailed information about every helper function in the Form Helper Functions search.

This table describes the functions/handlers in a typical form field where you might use helper functions. They are executed in order, with those at the top of the table first.

Function/HandlerExecutedDescription
Form Server-side Initialisation HandlerServer-sideThe server-side initialisation handler found in the Form Settings menu. This is the first function to be executed before the page is rendered. It will be executed on every page. As this field needs to take into account all pages, the Page Handler is often easier to use
Page Server-side Initialisation HandlerServer-sideThe server-side initialisation handler found in each page's settings. This function is executed after the form-level handler but before field default functions
Default FunctionsServer-sideAlmost every field type can have a default function. This property lets you enter a script that will be executed server-side as the field is generated.

It is mostly used to set the value of the field. That could be by calling another service (an End Point for example) or by calculating the value based on what's been entered in previous pages of the form
Form Client-side Initialisation HandlerBrowser-sideThe form client-side initialisation handler.

Allows you to enter script that is executed browser-side on every page once the page has been rendered. As this field needs to take into account all pages, the Page Handler is often easier to use
Page Initialisation Client-side HandlerBrowser-sideThe page initialisation handler.

Allows you to enter script that is executed browser-side once the page has been rendered. It is useful for showing and hiding multiple fields on a page
Validation FunctionBrowser-side repeated Server-sideMany of the input fields have a validation function. This property lets you enter a script that will calculate whether the value of the field is valid or not.

Validation is performed browser-side as field values are updated, and repeated server-side between pages and when the form is submitted. They return true for valid, false for invalid
HandlersBrowser-sideField handlers are executed browser-side on page load, and are also triggered whenever the value of the field changes. Whether the value of a field is valid or not is passed to the handler function as a parameter.

The scripts you enter here will power much of the dynamic behaviour of your form. Handlers can be used to show and hide fields, update field values, disable fields, change the options available in drop-downs, to name just a few.

Handlers have built in protection against circular events to prevent one field updating another, which then attempts to update the original field again

Examples

Default Functions

A field's default function can be used to set its initial value.

Event Handler Functions

Field handler functions are triggered when a field first loads and each time its value changes.

Form Field Functions

Get a field's value, update a field, show and hide, and enable or disable a field.

Form Button Functions

Showing, hiding, enabling, disabling and triggering buttons.

Share this page

Facebook icon Twitter icon email icon

Print

print icon