Skip to main content

On Exit

Last updated 25/07/2025

This documentation will demonstrate how the On Exit event works. The On Exit event is a client-side event. When exiting a field either by clicking or tabbing out of the field, the function attached to the On Exit event will execute. Effectively, as a user exits the field the event fires the code.



The Orders application is used to demonstrate the On Exit event.

Execute an On Exit Event

tip
The function being used for the On Exit event is the same as the function for the On Enter event, it will just be attached to a different event!

The

CalculateTotal()
function uses the
field
property on the
Five
object in the format
five.field.<fieldID>
to multiply the values in the Quantity and the Price fields and enters the calculated value into the Total field.

JavaScript
Calculate total
function CalculateTotal(five, context, result)  {
five.field.Total = five.field.Quantity * five.field.Price;
return five.success(result);
}

The

CalculateTotal()
function is saved in the Functions view in Five.


CalculateTotal function
Figure 1 - CalculateTotal function

The

CalculateTotal()
function is attached to the On Exit event for the Quantity field.


On Exit field
Figure 2 - On Exit field

In the Orders Application on the Orders form, a product is selected on the Order Items page, the Price field will then be populated by an On List Select event attached to the Products field. An amount can then be entered in the Quantity field and on exiting the field the On Exit event executes the

CalculateTotal()
function which calculates the total and populates the Total field.

note
You may need to refresh your screen to see the gif.

On Exit event
Figure 3 - On Exit event