# validate

Runs the current page validation routine.

## Action Object

| Key        | Type       | Description                                     |
| ---------- | ---------- | ----------------------------------------------- |
| `action`   | `string`   | Must be `"validate"`                            |
| `options`  | `object`   | No supported options at this time               |
| `onFailed` | `function` | Optional callback that runs if validation fails |

## Example

```json
{
  "actions": [
    {
      "action": "validate"
    },
    {
      "action": "runUtilityHook",
      "options": {
        "type": "save"
      }
    }
  ],
  "text": "Save This Form",
  "type": "button"
}
```

## Behavior Notes

* BetterForms emits the page validation event and waits for the form validation result.
* If validation succeeds, the action queue continues to the next action.
* If validation fails, BetterForms clears the pending action queue for that action run.
* If `onFailed` is supplied as a function, BetterForms calls it after validation fails.
* `validate` does not define any runtime `options` keys in the current implementation.

## Related Pages

* [Validation Overview](/reference/form-settings/validationoverview.md)
* [runUtilityHook](/reference/actions-processor/actions_overview/runutilityhook.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/reference/actions-processor/actions_overview/validate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
