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

# Using Input Text Validation

<div className="article_labels_list" style={{display: 'none'}} dangerouslySetInnerHTML={{__html: "has_image , End User , Box Sign , Overview , Article , Product Utilization , Established"}} />

Users can configure **Text Input** fields to accept or restrict the type of data that recipients can enter based on a specific format, style, or number range. These validation settings are configured within the document preparation experience when sending out a signature request or creating, modifying, or utilizing a reusable template.

## Configuring text input validation

To configure the **Text Input** field validation settings within a signature request or reusable template:

1. Add a **Text Input** field to the request or template.
2. Select the **Text Input** field to configure field settings.
3. Click to expand the **Validation** section.
4. Select your validation option:
   * **Predefined validation types**: Choose from standard formats like numbers, email, dates, ZIP codes, or SSN.
   * **Custom (Regular Expression)**: Create your own validation pattern for organization-specific requirements. See [Custom (Regular Expression) validation](#custom-regular-expression-validation) for setup instructions and examples.

<Frame>
  <img src="https://mintcdn.com/product-docs/kY6O1CxZeJPunHf3/images/box-sign/Field-Settings.png?fit=max&auto=format&n=kY6O1CxZeJPunHf3&q=85&s=be1c94d94384d145ac8b61fc672ec32f" alt="Field Settings.png" width="1440" height="3344" data-path="images/box-sign/Field-Settings.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/product-docs/kY6O1CxZeJPunHf3/images/box-sign/Validation.png?fit=max&auto=format&n=kY6O1CxZeJPunHf3&q=85&s=d7b7c2d052d525bc9f94ebd75f301316" alt="Validation.png" width="720" height="1744" data-path="images/box-sign/Validation.png" />
</Frame>

<Note>
  **Notes:**

  * Fields configured with text input validation cannot be configured as read-only fields and do not support multiple line data entry.
  * Predefined validations are supported via template tags, but the Custom (Regular Expression) option isn’t supported. For more information on template tags, see [Creating Templates Using Tags](/en/box-sign/templates/creating-templates-using-tags). For more information on the Custom (Regular Expression) option, see [Custom (Regular Expression validation)](#custom-regular-expression-validation) below.
  * All text input validations are supported via public API. For more information, see the [Box Sign API Reference](https://developer.box.com/reference/resources/sign-request/).
</Note>

## Supported validation types

The following table lists the various supported validation for **Text Input** fields:

| <strong>Validation option</strong> | <strong>Validation requirements</strong>                                                                                                                                                                                                                                             | <strong>Valid input example</strong>                                                                                                                                                       |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| None (default option)              | • No validation applied                                                                                                                                                                                                                                                              | N/A                                                                                                                                                                                        |
| Number                             | • Allow digits only (0-9)<br />• No spaces allowed<br />• No negative signs allowed<br />• Optional decimal separator:<br />  • Period (.)<br />  • Comma (,)<br />• Decimal separator cannot be followed or preceded by spaces or line breaks                                       | • 12345<br />• 12,345<br />• 12.345                                                                                                                                                        |
| Email                              | • Email syntax: [example@mail.com](mailto:example@mail.com)<br />• Minimum input must follow the format <em>*@*</em>.\* where each \* represents any alphanumeric character (except the domain, which cannot start with a number).<br />• No validation on the actual email address. | • [user@box.com](mailto:user@box.com)<br />• [user100@box.com](mailto:user100@box.com)<br />• [user@100box.com](mailto:user@100box.com)<br />• [user@box.100.com](mailto:user@box.100.com) |
| Date                               | • YYYY-MM-DD (ISO Standard) (default option)<br />• MM/DD/YYYY (US)<br />• DD/MM/YYYY (UK, EU)<br />• YYYY/MM/DD (JP, CH, KO)                                                                                                                                                        | • 2025-05-22<br />• 05/22/2025<br />• 22/05/2025<br />• 2025/05/22                                                                                                                         |
| ZIP Code                           | • ZIP (US-based) (default option)<br />• 5-digit numeric code: #####<br />• ZIP+4 (US-based)<br />  • 9-digit numeric code: #####-####<br />• ZIP (JP-based)<br />  • 7-digit numeric code: ###-###                                                                                  | • 12345<br />• 12345-6789<br />• 100-0001                                                                                                                                                  |
| SSN (Social Security Number)       | • US based.<br />• 9-digit numeric code: ###-##-####                                                                                                                                                                                                                                 | 000-00-0000                                                                                                                                                                                |
| Custom (Regular Expresion)         | Custom regex pattern defined by sender. See <a href="#custom-regular-expression-validation">Custom (Regular Expression)</a> section for details.                                                                                                                                     | Varies based on pattern                                                                                                                                                                    |

<h2 id="custom-regular-expression-validation">
  Custom (Regular Expression) validation
</h2>

Beyond the standard validation options, Box Sign offers a **Custom (Regular Expression)** option to customize validation for fields that need to meet requirements specific to your organization or region.

Custom validation uses **regular expressions (regex)**, which are sequences of characters that describe a specific pattern of allowed input for a field.

<Note>
  **Note:**

  Custom regex validation is supported through the public API. For more information, see the [Box Sign API Reference](https://developer.box.com/reference/resources/sign-request/).
</Note>

### Setting up custom validation

To configure custom validation:

1. Select **Custom (Regular Expression)** from the **Validation** dropdown menu.
2. Enter your regex pattern in the **Regular Expression Pattern** field. Provide an **Error Message** to display when the signer’s input is invalid.
3. (Recommended) Fill in the **Field Name (Label)** field to inform signers what data to populate in the field.

<Frame>
  <img src="https://mintcdn.com/product-docs/kY6O1CxZeJPunHf3/images/box-sign/Regex.png?fit=max&auto=format&n=kY6O1CxZeJPunHf3&q=85&s=50d191bad67243e07175ab3066079020" alt="Regex.png" width="720" height="1744" data-path="images/box-sign/Regex.png" />
</Frame>

Make sure your regex pattern uses a valid and supported format. Otherwise, you won't be able to apply the validation to the field. You might encounter two input errors: "Invalid pattern" if your regex pattern is invalid, or "Unsupported pattern" if your regex pattern is not supported by Box Sign guidelines. See [Regex pattern requirements](#regex-pattern-requirements) for supported syntax and limitations.

When the signer enters data, the system checks it against your pattern. If the input doesn't match, the field displays the error message you defined.

<h3 id="regex-pattern-requirements">
  Regex pattern requirements
</h3>

To ensure your custom regex pattern works correctly, follow these guidelines:

**Supported characters:**

* Unicode letters (`\p{L}`)
* Unicode numbers (`\p{N}`)
* Whitespace (`\s`)
* Common punctuation: `- ( ) . , ' \ / @ _ : % ! ? ^`
* Common international currency symbols: `$ € £ ¥ ₹ ₩ ₽ ₺ ₫ ₴ ₱`

**Box Sign does not support the following regex patterns:**

* Matching back references (`\\[1-9]`)
* Nested quantifiers (`++, **`)
* Lookbehinds (`(?<=, (?<!`)
* Recursive and conditional checks (`(?R), (?&)`)

### Example regex patterns

Below are useful examples of valid and supported regex patterns:

#### Phone numbers

| Use case                             | Regex pattern                                                               | Description                                                                                                     |
| ------------------------------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| US phone number                      | <code>^(\\+1\[-.\s]?)?(\\(?\d\{3}\\)?)\[-.\s]?\d\{3}\[-.\s]?\d\{4}\$</code> | Acceptable examples:<br /><br />• 123-456-7890<br />• (123) 456-7890<br />• 1234567890<br />• +1-123-456-7890   |
| Japan phone number                   | <code>^(\\+81\[-.\s]?)?(0?\d\{1,4})\[-.\s]?\d\{1,4}\[-.\s]?\d\{4}\$</code>  | Acceptable examples:<br /><br />• 03-1234-5678<br />• 045-123-4567<br />• 090-1234-5678<br />• +81-90-1234-5678 |
| International format (flexible)      | <code>^\\+?\[0-9]\[0-9\s.\\-]\{6,14}\$</code>                               | • Allows spaces, dots, or hyphens between digits<br />• 7–15 digits (ITU standard range)<br />• Optional “+”    |
| International Format (E.164-aligned) | <code>^\\+?\d\{7,15}\$</code>                                               | • Doesn’t allow spaces or special characters<br />• Accepts 7 to 15 digits<br />• Optional “+”                  |

#### Alphanumeric identifiers

| Use case                                  | Regex pattern                             | Description                                                              |
| ----------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------ |
| Alphanumeric Only                         | <code>^\[A-Za-z0-9]+\$</code>             | Letters and digits only, any length                                      |
| Alphanumeric with underscores             | <code>^\[A-Za-z0-9\_]+\$</code>           | Letters, digits, and underscores                                         |
| Alphanumeric with hyphens                 | <code>^\[A-Za-z0-9-]+\$</code>            | Letters, digits, and hyphens (common for contract IDs, tracking numbers) |
| Alphanumeric with underscores and hyphens | <code>^\[A-Za-z0-9\_-]+\$</code>          | Letters, digits, underscores, and hyphens                                |
| Prefix + digits (e.g. ABC-12345)          | <code>^\[A-Za-z]\{2,5}-\d\{3,10}\$</code> | Common for invoice or document numbers                                   |

#### Other common patterns

| Use case               | Regex pattern          | Description                                       |
| ---------------------- | ---------------------- | ------------------------------------------------- |
| Street Address         | ^\[0-9A-Za-z\s.,'-]+\$ | Allows numbers, letters, hyphens, and punctuation |
| Uppercase Letters Only | ^\[A-Z]+\$             | Accepts only uppercase letters                    |
| Lowercase Letters Only | ^\[a-z]+\$             | Accepts only lowercase letters                    |

## Known limitations

* Text input validation is not available for CFR Part 11 signature requests or templates.
