Form
Last updated 14/01/2026
Form Object
The
In Five, all events have an instance of the
- If an event attached to a form is called (ie, OnShow), the current form will befive.sender();
- If an event attached to a form page is called (ie, OnLeaving), the current form will befive.sender().getParent();
- If an event attached to a form field is called (ie, OnExit), the current form will befive.sender().getParent().getParent();
If you are in subforms, you can further call
What the Form Object Does
- Holds the current values entered into the form fields
- Lets you get field values programmatically
- Allows validation of user input
- Triggers logic when fields change or a form is submitted (saved)
How the Form Object Fits into an Application Flow
A typical lifecycle looks like this:
-
Form loads - fields are populated from data or defaults.
-
User interacts - by typing, selecting, or changing values.
-
Form object - values are stored internally, and form events are attached.
-
Your code reacts - it runs the logic, updates other fields, and shows messages or errors.
-
Form submits - final validation occurs, and data passed to the backend or workflow.
Summary
The
Functions on the Form Object
The following functions are available on the
actionID()
The
Available: Client
actionID() : string;
Return value: A string representing the unique identifier for the form action.
Examples:event()
The
Available: Client
event() : string;
Return value: A string representing the ID of the event that triggered the form logic.
Examples:getPage()
The
Available: Client
getPage(pageID: string) : FormPage;
| Parameter | Type | Description |
|---|---|---|
pageID | string | The Page ID for the page |
Return value: A
getParent()
The
By returning another form, it allows you to move up the form hierarchy. Forms in Five are nested, within a form, there is a main form that can have sub-forms,
Available: Client
getParent() : Form;
Return value : A
getValue()
The
Available: Client
getValue(fieldID: string) : any;
| Parameter | Type | Description |
|---|---|---|
fieldID | string | The Field ID for the form field |
Return value : Any value stored in the field, it can be a string, number, boolean, object, date, null/defined etc.
Examples:isCreate()
The
Available: Client
isCreate() : boolean;
Return value : boolean,
refresh()
The
The optional parameter gives you control over how much of the form hierarchy gets refreshed, but you don't have to provide it if you only care about the current form.
Available: Client
refresh([includeParents]) : void;
| Parameter | Type | Description |
|---|---|---|
includeParents | boolean | Optional: Refresh this form and all parents in the hierarchy |
Return value : void, this function does not return a value back to the caller.
Examples: