Plain JavaScript, run via flutter_js. Optional - only needed for checks that compare multiple fields against each other; a form's own required/min/max/regex rules (see the Form Editor) already cover single-field validation. Edited via the Script Editor. Runs after those static rules pass and before process.js - see the full processing pipeline.

APIs available

Name Type Meaning
inputs object The submitted values, keyed by field id. Each script runs in its own isolated context, so writing to it here has no effect anywhere else.
errors object Write validation messages into it. Its final state when the script finishes is what matters - the return value is ignored.
if (inputs.sale_price <= 0) {
  errors["sale_price"] = "Sale price must be greater than zero.";
}
if (inputs.year < 1900 || inputs.year > new Date().getFullYear() + 1) {
  errors["year"] = "Enter a valid model year.";
}

Field errors vs. general errors

Writing anything to errors - field-specific or general - stops the submission there; process.js doesn't run.