> For the complete documentation index, see [llms.txt](https://manual.bubble.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.bubble.io/help-guides/design/elements/web-app/input-forms/text-and-numbers.md).

# Text and number input elements (web)

Text and number inputs let users type text and numbers into your app. Learn how the input element's content formats work, and when to use the multiline input or Rich Text Editor.

Text and number inputs let your users provide their own text strings and numbers to your app, which can then be saved in the database or used in other ways.

There are a few different elements that are useful in various scenarios, and those elements can be set up to handle different kinds of formatting and user experiences.

## Input

{% hint style="info" %}
This is the user manual article on the **Input** element, which gives an overview of how the element works. If you want the technical reference that describes all the properties of this element, check out the reference entry:

**Reference:** [Input element](/core-resources/bubble-elements/element-properties/web-element-properties/input-form-properties/input-element.md)
{% endhint %}

Input elements are used for single-line plain text, but they allow you to specify a content format from a wide range of different options. The *Field type returned* in the list below specifies what kind of database field format the input will return.

<details>

<summary>How Bubble stores text formatting</summary>

Bubble uses a markup language called BBCode to store text formatting such as bold, italics, and bullet points. The BBCode is generated and applied automatically as you add formatting to your text.

BBCode is simpler and safer to use than HTML because it has more limited capabilities and only allows a select number of tags. This stops your users from being able to upload malicious code, such as CSS or JavaScript, that might break the app.

**External link:** [Guide to BBCode](https://www.bbcode.org/how-to-use-bbcode-a-complete-guide.php)\
**External link:** [BBCode tags reference](https://www.bbcode.org/reference.php)

### I want to use HTML instead

Sometimes it's useful to be able to store formatted text as HTML, such as when you want to pass formatted text to an email sending service that only supports this format.

None of the built-in Bubble text editors supports HTML formatting, but there are multiple [plugins](https://bubble.io/plugins) that allow you to store text with formatting as HTML instead of BBCode. Searching the Bubble Marketplace for *Rich Text Editor* is likely to give you some results that support this.

Regular text elements don't support HTML either. If you want to display text formatted with HTML, you can use the built-in **HTML** element.

</details>

{% hint style="info" %}
Because of the predictive text functionality on **Android devices**, some content formats involving masks have a slightly different UX. This applies to US Phone, Percentage, Currency, Date, Euro date, and Text (numbers only).

On Android devices, the input allows users to type anything and validates the content against the mask only after the user stops typing.

This doesn't affect the final data generated by the input.
{% endhint %}

### Text

The input will accept any text value.

**Field type returned:** text

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FInTKZvMONIQxfPSKSVpW%2Ftext%402x.png?alt=media&amp;token=421be641-2d5b-4675-8710-f37d7126f98f" alt="Text input showing the placeholder Jane Doe."><figcaption><p>An input with the <em>Text</em> format accepts any text.</p></figcaption></figure>

### Email

The input will only accept text values that are formatted like an email address.

**Field type returned:** text

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2Fm6aD5yFlD4Tw6mfcqcbq%2Femail%402x.png?alt=media&amp;token=a033ed96-2c29-4c59-a333-e7fb0911c675" alt="Text input showing the placeholder email@email.com."><figcaption><p>The <em>Email</em> format only accepts text formatted like an email address.</p></figcaption></figure>

### Password

The input will accept any kind of text value, but the characters written will be replaced by asterisks.

**Field type returned:** text

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2F3aRIcciAsCuViegIu7Mi%2Fpassword%402x.png?alt=media&amp;token=26edd9a2-888d-4c08-ba93-fcf560578656" alt="Text input with its characters masked as asterisks."><figcaption><p>The <em>Password</em> format hides each character as the user types.</p></figcaption></figure>

### Integer

The input will only accept whole numbers. Use this when you need to collect numerical values that can later be used for calculations (as opposed to numbers saved as text). You can specify a dynamic minimum and maximum value when this option is selected.

**Field type returned:** number

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2Fe6jK5JD1ni2VzvNUApcl%2Fnumber%402x.png?alt=media&amp;token=1214cbe9-2562-461f-ad53-ab361c18cbc1" alt="Text input containing the whole number 256."><figcaption><p>The <em>Integer</em> format accepts whole numbers.</p></figcaption></figure>

### Decimal

The input will accept any whole number or decimal number. You can specify a minimum and maximum value, as well as the number of decimals to include. You can also set the input to automatically include thousands separators as the user types. This property is only aesthetic and doesn't affect the final value.

**Field type returned:** number

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2F4NeDo1RfcLxUFFCePerI%2Fdecimal%402x.png?alt=media&amp;token=8e5338a9-2ca0-4f0e-8d67-a869657202b1" alt="Text input containing the decimal number 29.99."><figcaption><p>The <em>Decimal</em> format accepts whole and decimal numbers.</p></figcaption></figure>

### Address

A geographic address. With this option, the input automatically validates the address with Google Maps. Note that the input doesn't automatically search for valid addresses as the user types, so the user has to provide an already valid address (for example, by copying and pasting it from Google Maps). If you want the user to be able to see Google Maps search results as they type, you may want to look into using the **Search box** element instead.

**Field type returned:** address

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FGVivkTJGssfNGhQvNdmM%2Faddress%402x.png?alt=media&amp;token=7c40eb55-aef2-49b7-befb-249163d87341" alt="Text input containing the address Eiffel Tower, Avenue Anatole France, Paris, France."><figcaption><p>The <em>Address</em> format validates the address with Google Maps.</p></figcaption></figure>

### US phone

This input will accept correctly formatted US phone numbers. The value is saved as text.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FAgqbtzv0TVN3bV0iOYQN%2Fus-phone%402x.png?alt=media&amp;token=227727f9-a957-48a5-8fb7-0598b022db89" alt="Text input containing a US phone number formatted as (123) 123-1231."><figcaption><p>The <em>US Phone</em> format guides the user to enter a correctly formatted US phone number.</p></figcaption></figure>

**Field type returned:** text

### Percentage

This input will format the user's input as a percentage and accept input such as 20%. Bubble will automatically save it as the numerical equivalent of the percentage. For example, 20% will be saved as the number 0.2 and 150% will be saved as 1.5.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FvfMAM9iJsLqOwF51OjI1%2Fpercentage%402x.png?alt=media&amp;token=35a01748-e0d2-441d-95cb-6f577548dd75" alt="Text input containing the value 25%."><figcaption><p>With the <em>Percentage</em> format, a value of 25% is saved as the number 0.25.</p></figcaption></figure>

**Field type returned:** number

### Currency

The input will accept any whole number or decimal number, and it will automatically format the input in the chosen currency, such as *$20*. You can specify a minimum and maximum value, as well as the number of decimals to include. You can also set the input to automatically include thousands separators as the user types. The currency and thousands separators properties are only aesthetic and don't affect the final value.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FyztzWebFtLYcJztKMC3q%2Fcurrency%402x.png?alt=media&amp;token=05c2ba6c-b6c7-4eb7-9640-c5619da9ec36" alt="Text input containing the value $29.99."><figcaption><p>The <em>Currency</em> format shows a currency symbol, but the value is saved as a plain number.</p></figcaption></figure>

**Field type returned:** number

### Date

The input will accept any date, but doesn't include time. It automatically formats the input's value as mm/dd/yyyy while the user types, guiding the user to provide the date in the right way. You can specify a given time zone for the input, and Bubble will automatically calculate any offset from the user's current time zone. If no time zone is provided, the user's current time zone will be used. Dates are saved at 12 AM (00:00) on the given date.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FJAGmtVIWYWJ0e6pB8Aly%2Fus-date%402x.png?alt=media&amp;token=95a6439b-1be4-4594-97a5-9da57d79e6d0" alt="Text input containing the date 01/31/1970."><figcaption><p>The <em>Date</em> format uses the mm/dd/yyyy pattern.</p></figcaption></figure>

**Field type returned:** date

### Euro date

The input will accept any date, but doesn't include time. It automatically formats the input's value as dd/mm/yyyy while the user types, guiding the user to provide the date in the right way. You can specify a given time zone for the input, and Bubble will automatically calculate any offset from the user's current time zone. If no time zone is provided, the user's current time zone will be used. Dates are saved at 12 AM (00:00) on the given date. The difference between this content format and the *Date* format is purely visual.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2F0BmnRHhScazb0dMZYlRI%2Feuro-date%402x.png?alt=media&amp;token=72150c54-01c9-497c-8722-e98f7f877616" alt="Text input containing the date 31/01/1970."><figcaption><p>The <em>Euro date</em> format uses the dd/mm/yyyy pattern.</p></figcaption></figure>

**Field type returned:** date

### Text (numbers only)

This input will only accept whole numbers, and the result will be saved as text. This is useful when you want to save numerical values that need to remain exactly as the user typed (without losing leading zeros, for example) and won't be used for any type of calculation, such as international phone numbers, zip codes, and order numbers.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2Fe6jK5JD1ni2VzvNUApcl%2Fnumber%402x.png?alt=media&amp;token=1214cbe9-2562-461f-ad53-ab361c18cbc1" alt="Text input containing the number 256."><figcaption><p>The <em>Text (numbers only)</em> format accepts whole numbers but saves them as text.</p></figcaption></figure>

**Field type returned:** text

<details>

<summary>Storing numbers as text versus storing them as numbers</summary>

### What is the difference between the two?

The Bubble database offers two different field types that can both be used to save numerical values: text and number.

There are a few scenarios where it makes sense to save a number as a text string:

#### When you need to include leading zeros

In an integer (or number), a leading zero represents no value and is disregarded when saved to the database. After all, 045 and 45 are the same thing from a mathematical point of view, and the zero only adds confusion and increases the total size of the database.

Sometimes leading zeros are necessary. For example, a phone number or zip code might start with a zero, and it must be stored as text to preserve the complete value.

#### When you need to pass the data as text

Sometimes when you communicate with an external system through an API, that system may expect a numerical value to be passed as text. In that case, it can be useful to store it as text in the database to avoid having to convert it later.

### When to use what

**Text** should be used when you're working with numerical values that will remain static and won't be included in any calculations. For example:

* Phone numbers
* Zip codes
* Postal codes
* Product and part numbers

**Numbers** should be used when you're working with values that may need to be calculated or aggregated, such as:

* Year of birth
* Age
* Counts and totals (such as the number of items in a cart and the cart's total value)
* Financial numbers
* Enumerated values, such as the values used to represent the days of the week (for example, Sunday = 0 and Monday = 1)

</details>

## Multiline input

As the name suggests, the **Multiline input** element allows you to set up a text input element that allows for multiple lines of text. Like the regular text input, this element supports plain text only and doesn't provide any custom formatting.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FUDrMISeQa5egr2vOohbB%2Fmultiline-input%402x.png?alt=media&amp;token=055a0a9d-b10c-4635-b880-d6a7dec1c5a7" alt="Multiline input containing two paragraphs of placeholder text."><figcaption><p>The <strong>Multiline input</strong> element accepts several lines of plain text.</p></figcaption></figure>

Use the **Multiline input** element when you need the user to be able to supply multiple lines of text, but you don't want them to be able to add formatting such as bold, italics, and headers.

**Field type returned:** text

## Rich Text Editor

{% hint style="info" %}
The Rich Text Editor is a plugin. It's made by Bubble, but it needs to be installed in your app before you can use it.

**Plugin:** [Rich Text Editor](https://bubble.io/plugin/rich-text-editor-1580238841425x582072028873097200)
{% endhint %}

The Rich Text Editor is another multiline input element that lets users type rich text with formatting such as colors, fonts, bullet points, and links.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FREPyaEdYlHl77vIdrdQg%2Frich-text-editor-bubble%402x.png?alt=media&amp;token=a30f8db4-e0b4-4c6f-8a0c-86e824ba23c3" alt="Rich Text Editor with a formatting toolbar above a heading and two paragraphs of text."><figcaption><p>The Rich Text Editor plugin lets your users add advanced formatting to their text.</p></figcaption></figure>

### Hidden toolbar

The Rich Text Editor element comes with a property that gives it a more minimalistic design, where the toolbar is only visible when you select some text.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FmMx4SwjPPu3fj4BqNKt7%2Frich-text-editor-tooltip%402x.png?alt=media&amp;token=487d4740-fc23-4483-bad5-6c7f26a4157f" alt="Rich Text Editor with a dark floating toolbar shown below a selected word."><figcaption><p>With the toolbar hidden, it only appears when the user selects text.</p></figcaption></figure>

You can also choose to show fewer formatting options than the ones above. The screenshot shows the full suite of available options.

## More ways to learn

<details>

<summary><mark style="color:blue;">Core reference:</mark> text input</summary>

**Reference:** [Input element](/core-resources/bubble-elements/element-properties/web-element-properties/input-form-properties/input-element.md)

</details>

<details>

<summary><mark style="color:blue;">Video lessons</mark></summary>

* [How to use the text input element](https://youtu.be/C7Yg9JbVQsI)
* [How to use text transform operators](https://www.youtube.com/watch?v=kmvmYAlrjUk\&t=5s)

</details>
