> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# On Text Field Validating

> Validate text field edits with the On Text Field Validating event in FlexiCapture; set CanApply to false to undo or accept the user's input.

## When it is launched

The script is launched when the control is validating the user editing of a text field, e.g. when trying to choose the value from suggestions or when the control loses focus.

* If the **CanApply.Value** property is set to **true**, the user input will be validated after the script execution.
* If the **CanApply.Value** property is set to **false**, the user editing will be undone.

By default, the value of the **CanApply** parameter is **true**.

## Parameters

| **Name** | **Type**                                                         | **Access** | **Description**                   |
| -------- | ---------------------------------------------------------------- | ---------- | --------------------------------- |
| CanApply | [IBoolean](/flexi-capture/appendix/scripts-shell/iboolean)       | Read/write | Specifies whether to save changes |
| Context  | [ITextEditor](/flexi-capture/appendix/scripts-shell/itexteditor) | Read/write | The document field editor         |
