# MaskedTextbox

**Category:** Field

**Version:** 1.0

**Last Updated:** November 19, 2025

**Author:** Any2Info

***

### **Description**

The **MaskedTextbox** field allows users to enter text, numbers, or symbols in a **predefined format** set by the form creator.

It appears as a standard textbox with **placeholder values** that visually represent the **mask structure**.

This field is ideal when input must follow a specific format — for example, a **postal code**, **phone number**, or **email address**.

***

### **General Properties**

The MaskedTextbox field inherits all [**general field properties**](https://www.notion.so/MaskedTextbox-Field-2a2ea901b1b880d6a736d7ca5c2887e1?pvs=21) such as:

* Font size
* Font color
* Border color

*(If general field properties are documented elsewhere, link to that page instead.)*

***

### **Special Properties**

The MaskedTextbox field includes two special properties:

| **Property**                | **Description**                                               |
| --------------------------- | ------------------------------------------------------------- |
| **Type** *(Simple / Email)* | Defines the behavior of the MaskedTextbox.                    |
| **Mask**                    | A pattern of characters that determines which input is valid. |

#### **Type**

* **Simple** – Uses the specified Mask for input validation.
* **Email** – Ignores the Mask and enforces standard email formatting rules.

#### **Mask**

A Mask defines the structure of the input and can contain the following characters:

| **Character** | **Meaning**                                                 |
| ------------- | ----------------------------------------------------------- |
| `0`           | Required digit (0–9)                                        |
| `9`           | Optional digit or space                                     |
| `#`           | Digit or space (optional), allows `+` or `-`                |
| `L`           | Required letter (`a`–`z` or `A`–`Z`)                        |
| `C`           | Optional letter or space                                    |
| `A`           | Required alphanumeric character (`a`–`z`, `A`–`Z`, `0`–`9`) |
| `a`           | Optional alphanumeric character                             |

> Note:
>
> The **Mask** property only applies when **Type = Simple**.
>
> When **Type = Email**, the mask is ignored.

***

### **Tips & Best Practices**

* **Don’t create your own email mask.** Use the predefined Email type — it automatically enforces correct formatting.
* **Be intentional about allowed input.** Optional mask characters (like `a`) can lead to incomplete input (e.g., `1234` instead of `1234AA` for a postal code).
* **Provide clear instructions** to users if your mask enforces strict patterns.

***

### **Errors**

| **Error Message**                            | **Meaning**                                        | **Solution**                                                 |
| -------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------ |
| *The input value does not match the format.* | The user’s input does not follow the defined mask. | Adjust the mask or clarify the expected format for the user. |

***

### **Examples**

#### **Simple Mask**

In the following example, the user must enter **four digits (0–9)** followed by **two required letters** (A–Z or a–z).

**Valid examples:**

`0000AA`, `1234Jl`, `4065aa`

**Invalid example:**

`0000a_` (second letter missing)

<figure><img src="https://870194474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_kE41Rl4pOtwKfvvQq%2Fuploads%2FBIQyrRtCmdQPvGKApV3h%2Fimage.png?alt=media&#x26;token=598910b9-40c3-4fd3-81ae-f4147335744e" alt=""><figcaption></figcaption></figure>

***

#### **Email Mask**

In this example, the **Type** is set to **Email** and a **Mask** is also defined.

Since the **Email** type takes precedence, the mask is ignored — only valid email addresses are accepted.

<figure><img src="https://870194474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_kE41Rl4pOtwKfvvQq%2Fuploads%2FnEkLmiOan3NGil8z0GCf%2Fimage%201.png?alt=media&#x26;token=6f8baa92-40d3-44fb-9fe4-006184b8990d" alt=""><figcaption></figcaption></figure>

***

### **Changelog**

| **Version** | **Date**          | **Change**                           |
| ----------- | ----------------- | ------------------------------------ |
| 1.0         | November 19, 2025 | Initial documentation version added. |
