Skip to main content

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:

  1. The On Submit event executes.
  2. Any logic associated with the event executes before the data is sent to the server.
  3. 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.

JavaScript
Show message on submit
function SaveForm(five, context, result) {
five.showMessage('Your changes are about to be saved');
return five.success(result);
}