# ValidationRule Interface

> ValidationRule interface in the TX Sheet Control TypeScript API for the browser: Constraints enforced on editor and API edits.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Interface
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > ValidationRule Interface
- **1063 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/llms-full.txt

---

Constraints enforced on editor and API edits. Blank values require allowBlank.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

Type-only declaration; it is not a JavaScript runtime constructor.

### Members

#### Properties

| Property | Description |
|---|---|
| [allowBlank](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/allowblank-property/llms-full.txt) | The allowBlank value of ValidationRule. |
| [errorMessage](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/errormessage-property/llms-full.txt) | The errorMessage value of ValidationRule. |
| [errorStyle](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/errorstyle-property/llms-full.txt) | The errorStyle value of ValidationRule. |
| [errorTitle](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/errortitle-property/llms-full.txt) | The errorTitle value of ValidationRule. |
| [formula1](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/formula1-property/llms-full.txt) | The formula1 value of ValidationRule. |
| [formula2](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/formula2-property/llms-full.txt) | The formula2 value of ValidationRule. |
| [id](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/id-property/llms-full.txt) | The id value of ValidationRule. |
| [inputMessage](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/inputmessage-property/llms-full.txt) | The inputMessage value of ValidationRule. |
| [inputTitle](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/inputtitle-property/llms-full.txt) | The inputTitle value of ValidationRule. |
| [operator](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/operator-property/llms-full.txt) | The operator value of ValidationRule. |
| [range](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/range-property/llms-full.txt) | The range value of ValidationRule. |
| [showDropdown](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/showdropdown-property/llms-full.txt) | The showDropdown value of ValidationRule. |
| [showErrorMessage](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/showerrormessage-property/llms-full.txt) | The showErrorMessage value of ValidationRule. |
| [showInputMessage](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/showinputmessage-property/llms-full.txt) | The showInputMessage value of ValidationRule. |
| [type](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/type-property/llms-full.txt) | The type value of ValidationRule. |
| [values](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/values-property/llms-full.txt) | The values value of ValidationRule. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```typescript
import type { Workbook } from '@txtextcontrol/tx-sheet-control';
import type { ValidationRule } from '@txtextcontrol/tx-sheet-control';

function createValidationRuleReport(book: Workbook, settings: ValidationRule) {
    const sheet = book.sheets.at(0);
    sheet.cell('A1').setText('October invoice');
    sheet
        .cell('A1')
        .format({
            fontFamily: 'Liberation Sans',
            fontSize: 16,
            bold: true,
            textColor: '#ffffff',
            fillColor: '#163b63',
        });

    sheet.columns.at(0).setWidth({ pixels: 240 });
    sheet.range('B8:B9').setValues([[120], [80]]);
    sheet.cell('B10').setFormula('=SUM(B8:B9)');
    sheet.range('B8:B10').format({ numberFormatCode: '#,##0.00', fontSize: 11 });
    sheet.validation.set('B8:B9', settings);
    return sheet;
}
```

### See Also

- [TypeScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/llms-full.txt)
- [Data Validation](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/validation/llms-full.txt)

---

## In This Section

- [ValidationRule.allowBlank Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/allowblank-property/llms-full.txt): ValidationRule.allowBlank property in the TX Sheet Control TypeScript API for the browser, with its type boolean | undefined and a TypeScript example.
- [ValidationRule.errorMessage Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/errormessage-property/llms-full.txt): ValidationRule.errorMessage property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.errorStyle Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/errorstyle-property/llms-full.txt): ValidationRule.errorStyle property in the browser TypeScript API, with its type "stop" | "warning" | "information" | undefined and a TypeScript example.
- [ValidationRule.errorTitle Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/errortitle-property/llms-full.txt): ValidationRule.errorTitle property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.formula1 Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/formula1-property/llms-full.txt): ValidationRule.formula1 property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.formula2 Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/formula2-property/llms-full.txt): ValidationRule.formula2 property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.id Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/id-property/llms-full.txt): ValidationRule.id property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.inputMessage Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/inputmessage-property/llms-full.txt): ValidationRule.inputMessage property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.inputTitle Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/inputtitle-property/llms-full.txt): ValidationRule.inputTitle property in the TX Sheet Control TypeScript API for the browser, with its type string | undefined and a TypeScript example.
- [ValidationRule.operator Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/operator-property/llms-full.txt): ValidationRule.operator property in the TX Sheet Control TypeScript API for the browser, with its type ValidationOperator | undefined and a TypeScript example.
- [ValidationRule.range Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/range-property/llms-full.txt): ValidationRule.range property in the TX Sheet Control TypeScript API for the browser, with its type string and a TypeScript example.
- [ValidationRule.showDropdown Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/showdropdown-property/llms-full.txt): ValidationRule.showDropdown property in the TX Sheet Control TypeScript API for the browser, with its type boolean | undefined and a TypeScript example.
- [ValidationRule.showErrorMessage Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/showerrormessage-property/llms-full.txt): ValidationRule.showErrorMessage property in the TX Sheet Control TypeScript API for the browser, with its type boolean | undefined and a TypeScript example.
- [ValidationRule.showInputMessage Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/showinputmessage-property/llms-full.txt): ValidationRule.showInputMessage property in the TX Sheet Control TypeScript API for the browser, with its type boolean | undefined and a TypeScript example.
- [ValidationRule.type Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/type-property/llms-full.txt): ValidationRule.type property in the TX Sheet Control TypeScript API for the browser, with its syntax and a TypeScript example.
- [ValidationRule.values Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/values-property/llms-full.txt): ValidationRule.values property in the TX Sheet Control TypeScript API for the browser, with its type string[] | undefined and a TypeScript example.

---

## Nearby

- **Previous:** [ValidationOperator Type](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationoperator/llms-full.txt)
- **Next:** [ValidationRule.allowBlank Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/validationrule/allowblank-property/llms-full.txt)
