Go to Scriptcase store

# onValidate - Form
View video

This event occurs during the data validation in a form application.

This event is executed when the form is submitted to the server, using the buttons: "add", "change" or "delete"
In this event, it is allowed to perform validations before the form data is sent to the database.

In the example below, using the form_orders application, we will validate the freight field, where if the value assigned to the freight field is greater than 30, an error message will be triggered to the user and the form submission will be cancelled.

Code example:
if({freight} > 30){
sc_error_message("Shipping value is too high");
}