The timer field executes its handler when the timer starts, stops, or after a set period. The timer countdown can be set to start on page load or triggered by another event using the
Field Values and the Handler
Like any field, the timer's handler is triggered when the field's value changes. The timer has three possible values,
Custom Functions
Custom functions can be called from the handlers of other fields using .invokeCustomFieldFn.
startTimer() - starts the timerstopTimer() - stops the timerchangeRepeat(newrepeat) - a boolean to toggle the repeat property between true and falsechangeInterval(newInterval) - an integer value to change the interval to
Properties
Label | Description | Type Name |
---|---|---|
Interval (milliseconds) | The number of milliseconds until the handler function is called | INTERVAL |
On Load | Either true or false for whether or not the timer should start counting down on page load | ONLOAD |
Repeat | If true the timer will repeat using the set interval. If false the timer will only fire once | REPEAT |
Handler | The JavaScript function that will be executed when the timer reaches zero or the field value changes | HANDLERS |
Documentation | Add documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an example | DOCUMENTATION |
Examples
This example imagines a timer that will hide then reveal another field. It is started by someone pressing a button.
The timer field has been set up like this:
The handler on the timer field hides a field when the timer starts, then reveals the field when the time runs out:
To start the timer, a script button invokes the timer's custom function: