Before Submit
The Before Submit event fires after the form is submitted but before any processing of the data.
This is a server-side ProcScript event.
Available Variables
All variables exposed in 1️⃣Before Process are exposed, with the addition of:
form_action
- create / update / delete
item_id
- for Edit records only - ID of the item
form_values
- Array of values submitted, eg: {title:"foo", etc}
Return
If you want the submission to fail, you need to return
the error message.
Examples
Maybe you want to make sure that “email_address” has an “@” symbol in it:
if ( form_values["email_address"].indexOf("@") < 0 ) {
return "Invalid Email Address";
}
Or maybe you want to default a value that was hidden to the user:
form_values["hidden-field"] = my_variables["previously-saved-value"];