# Text Field

## Element Description

The **Text Field** allows you to collect basic input from users. It can be used to gather information such as names, addresses, or any other single-line text data. You can customize the label, placeholder, and other settings to match the specific needs of your store’s checkout process.

<figure><img src="/files/Cd9JX44doYvGacC2BReq" alt=""><figcaption></figcaption></figure>

**Sample Use Cases**

* Collect customer first and last names during checkout.
* Gather short feedback or additional notes from customers.
* Use for custom fields like referral codes or promo codes.

<figure><img src="/files/Y9JKWB7UDDfOpMRDRtxa" alt=""><figcaption><p>Text Fields</p></figcaption></figure>

## **Text Field** Settings

<figure><img src="/files/OZzSClgnDlUNZ5hvVoaI" alt=""><figcaption></figcaption></figure>

* **Label** – The name of the field displayed to the customer on the checkout page.
* **Placeholder** – The text that appears inside the input box before the customer types anything.
* **Description** – Additional information or instructions about the field, displayed below the input box.
* **Enable/Disable Field** – Allows you to enable or disable the field based on your needs. If it is disabled, the element will not be displayed in the checkout form, you can enable it anytime from the checkout builder according to your needs.
* **Is Required** – If enabled, the customer must fill in this field before proceeding with checkout.
* **Default Value** – The pre-filled value that will appear in the field when the page loads.
* **Max Length** – The maximum number of characters that the customer can enter in this field.

**Advanced Settings**

* **Custom Class Name** – Add [**custom CSS classes**](/checkout-custom-fields-builder-for-woocommerce/plugin-features/custom-classes.md) to the field for styling or functionality.
* **Allowed Characters (Regex)** – Set a regular expression to define allowed characters that can be input into this field.
* **Error Message** – Customize the error message that appears if the validation for the field fails.


---

# 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.stylemixthemes.com/checkout-custom-fields-builder-for-woocommerce/checkout-builder-elements/text-field.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.
