DocsForm validation · FQL
On this page

Validate a form

Reuse an FRL schema and check form state.

Use Frontbacked.state.check(path, schema, options?) to validate browser state before calling APIs such as signUp, createPost, updatePost, or updateUserData.

Field errors appear below the corresponding input, within its label or field group. Frontbacked associates each error with the input for screen readers and removes that association when the field passes validation. Grid and flex forms keep the error with its field.

Client validation is for fast feedback: it catches missing values, wrong file types, oversized files, and invalid form shapes before the user waits on a request. FRL schemas still protect saved data, so use both: FQL validation for friendly forms, FRL validation for the final data contract.

Reuse FRL Schemas

When a theme has FRL rules, use Frontbacked.schemas.post(...) or Frontbacked.schemas.profile(...) to start from that saved-data contract and adjust only what the browser form needs.

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Use pick for small forms, omit for fields the page should not submit, patch for field-specific browser messages, and add for browser-only checks such as terms acceptance.

Basic Form Validation

index.html
js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

result.values contains normalized values. In the example above, name is trimmed and email is trimmed and lowercased.

Continue with Validate files before saving.