Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/03-code-internals/21-form-kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -1329,14 +1329,14 @@ Field accepts a `@validate` property which allows you to define a callback funct

- `name` (string): The name of the form field being validated.
- `value` (string): The value of the form field being validated.
- `data` (Object): The data object containing additional information for validation.
- `handlers` (Object): An object containing handler functions.
- `data` (Object): The data object containing additional information for validation.
- `handlers.addError` (Function): A function to add an error if validation fails.

**Example**

```js
validateUsername(name, value, data, { addError }) {
validateUsername(name, value, { data, addError) {
if (data.bar / 2 === value) {
addError(name, { title: I18n.t(`foo.bar.${name}`), message: "That's not how maths work." });
}
Expand Down
Loading