On this page
Check state before submitting
Validate account fields before calling a client method.
Before you begin: Submit a record form.
Checking State Before Submit
Use Frontbacked.state.check(path, schema, options?) when a handler needs validated state before it can continue. It can check one field or a whole object. When a field fails, Frontbacked shows a message and returns a result with ok: false.
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
Then check the whole state object:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
To check one field, pass that field's schema:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
The optional third argument lets you collect errors across several checks:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
Continue with Show state validation errors.