On Submit
Last updated 10/04/2026
Overview
The On Submit event is a client-side event that executes when a user clicks the Save button on an action loaded via a URL.
How it Works
When a user clicks the Save button:
- The On Submit event executes.
- Any logic associated with the event executes before the data is sent to the server.
- You can allow the save to proceed or stop based on conditions.
Use Cases
- Validate form data before submission
- Prevent saving if required conditions are not met
- Display messages or confirmations to the user
- Modify and prepare data before it is sent to the server
- Run client-side checks without needing a server call
Example
This function executes when the Save button is clicked and shows a message in the UI.
Show message on submit
function SaveForm(five, context, result) {
five.showMessage('Your changes are about to be saved');
return five.success(result);
}