On Enter
Last updated 26/03/2026
Overview
The On Enter event is a client-side event that executes when a user places focus on a form field. This typically occurs when the user clicks into the field or navigates to it using the keyboard, allowing the application to respond as soon as the field becomes active.
How it Works
When a user enters a field:
- The field gains focus.
- The On Enter event executes.
- Any associated logic runs before the user starts typing.
Use Cases
- Perform calculations
- Set default values dynamically when the user focuses on the field
Example
This function executes when the user enters the Total field, automatically calculating the total by multiplying the Quantity and Price fields and updating the Total field.
Calculate total on enter
function CalculateTotal(five, context, result) {
five.field.Total = five.field.Quantity * five.field.Price;
return five.success(result);
}