Skip to content
Bugwise
Menu
UI Components

Text Field

The box where users type names, emails, passwords and messages. Learn its parts, the keyboards it opens, when errors should appear, and the inputs that break it.

50–75 min Inputs & selection iOS · Android · Web Also called: Text input, Input field, EditText

Signing up for a food delivery app, searching for a flight, typing a card number, leaving a note for the courier: almost every journey in an app goes through a text fieldText fieldAn input where the user types text, like a name, email, password or search query.Open in glossary →. It’s the most common input on the planet, and because users can type anything into it, it’s also one of the richest places to find bugs.

In this lesson you’ll learn what a good text field looks like on each platform, and how testers break the bad ones. For whole forms (validation timing, error summaries, server errors and real-world data), see Forms and Validation.

Part Not started

What is a text field?

A text field is a box that accepts free text from the keyboard. It can be a single line (name, email, promo code) or several lines (a review, delivery instructions). Unlike a dropdown or a toggle, the user isn’t choosing from options: they can enter any character, in any amount, in any language. That freedom is exactly what makes it risky.

You’ll usually see text fields used for:

  • Personal data: name, email, phone number, address.
  • Secrets: passwords, PINs, one-time codes.
  • Search: products, recipes, destinations.
  • Free-form content: reviews, chat messages, notes for the courier.
  • Numbers that aren’t really “numbers”: postcode, card number, quantity, amount.

Anatomy

  1. 1

    Label

    Tells the user what to enter. Always visible, even after typing.

  2. 2

    Input area (container)

    The box you tap or click. Holds the value the user types.

  3. 3

    Placeholder

    Optional example text inside an empty field. Disappears when you type, so it is not a label.

  4. 4

    Helper text

    Extra guidance below the field: format, why we need it, if it is optional.

  5. 5

    Error message

    Replaces the helper text when the value is wrong. Says what to fix.

  6. 6

    Character counter

    Shows how many characters are used out of the limit.

  7. 7

    Leading / trailing icon

    A hint icon (mail) or an action icon (show password).

  8. 8

    Clear button

    Empties the field in one tap. Shown only when there is text.

How it differs from similar components

ComponentWhat the user doesTypical use
Text fieldTypes a short, single lineName, email, promo code
Text area (multiline field)Types several linesReviews, messages, delivery notes
Search fieldTypes to find something, usually with instant resultsProduct search, filtering a list
Dropdown / selectPicks one value from a fixed listCountry, size, sort order
Combo boxTypes to filter a list, then picksChoosing a city from thousands
Date pickerPicks a date from a calendar or wheelBirthday, booking dates
Dev note

iOS calls it a text field (UITextField, or TextField in SwiftUI) and a text view for multiline. Android developers say EditText, while Material Design says text field. On the web it’s an <input> element (or <textarea> for multiline). In bug reports, use the name your team uses.

Check this part

  1. Why is a text field riskier to test than a dropdown?

  2. The user has to choose a country from a fixed list. Which component fits better than a text field?

A box for free text from the keyboard, on one line or several, and how it differs from search fields, dropdowns, combo boxes and date pickers.

Part Not started

Designs & variants

Each platform has its own look. The parts are the same, but the risks differ: a floating label can overlap autofilled text, a left-hand label can truncate, a field with no visible label can confuse everyone.

Every field below is live: click, type, clear, and tab through them. Use the switch to compare light and dark.

Delivery address

Grouped form

iOS

Rows inside a rounded group, like Settings. The label sits on the left, so long labels and large text are the risk here.

As shown on your ID

Filled text field

Android · Material 3

Tinted box with an underline. The label floats up when you focus or type. Watch for labels overlapping autofilled text.

Outlined text field

Android · Material 3

The floating label cuts into the border. A leading icon hints at the content; the clear button appears once you type.

We'll send your order updates here.

Label above

Web

The most common web pattern. The label never moves, which makes it the easiest to read and to test.

At least 8 characters

Password with show/hide

All

The eye button reveals the password. Check it toggles both ways and that the value is never lost when you switch.

Search field

iOS

No visible label, so the placeholder and the icon do the job. Screen readers still need a name ('Search').

32/80

Multiline with counter

Android · Material 3

For longer text. The counter counts characters the way people see them. Go over the limit to see the error.

Can't be changed after ordering.
A postcode has 5 digits, like 10000.

Disabled and error states

Web

Disabled fields are dimmed and can't be focused. An error turns the border red and says how to fix the value.

Types and mobile keyboards

On a phone, the field’s type decides which keyboard appears. A missing or wrong type is a real, reportable bug: imagine typing an email on a keyboard with no @ key, or a postcode on a full letter keyboard.

⌨️ One field, many keyboards

On a phone, the input type decides which keyboard opens. Pick a field type and see what the user gets.

Web (HTML)
type="email" autocomplete="email"
iOS keyboard type
.emailAddress, autocapitalization off
Android inputType
textEmailAddress

What to check

The @ and . keys are visible, the first letter is NOT capitalized, and autocorrect does not "fix" the address.

States

A text field goes through several UI statesUI stateHow a component looks and behaves in a given situation: default, hover, pressed, focused, disabled, loading, error.Open in glossary →. Each one needs to look different and behave correctly.

StateWhat it looks likeWhat to check
EmptyLabel and maybe a placeholderPlaceholderHint text shown inside an empty input field that disappears when the user starts typing.Open in glossary →The placeholder is an example, not the only label
FocusedHighlighted border, cursor blinking, keyboard openFocus is clearly visible (not only a color change)
FilledShows the valueLong values scroll or wrap; nothing is cut off on save
DisabledDimmed, can’t be focusedCan’t be edited by tapping, Tab key, or autofill. See disabled stateDisabled stateA component that is visible but can't be used right now, usually shown greyed out.Open in glossary →
Read-onlyLooks like text, can be selected and copiedCan’t be changed, but CAN be copied and read by screen readers
ErrorRed border and a messageThe message explains how to fix it, and disappears once fixed
LoadingSmall spinner, e.g. “Checking username…”Typing fast doesn’t show the result for an old value

When should errors appear?

Input validationInput validationChecking that what the user typed is acceptable before the app uses it.Open in glossary → checks the value. The tricky part is timing. Show the error too early and you nag the user mid-sentence; show it too late and they discover all problems at the end. Try the three common strategies:

⏱️ When should the error appear?

Pick a strategy, then type an address slowly, e.g. "anna@test.com". Try leaving the field half-done, too.

Sign in to FreshCart

We'll email you a one-time code.

0

times an error popped up while typing

—

no error shown

On blur

No error until you leave the field. After that, the field re-checks as you type, so the error disappears the moment the value is fixed. This "late to complain, quick to forgive" approach is the usual recommendation.

Autofill and autocomplete

Phones and browsers can fill in names, addresses, passwords and one-time codes for the user. It only works if each field tells the system what it contains.

Dev note: Autofill values per platform
FieldWeb autocompleteiOS textContentTypeAndroid autofillHints
Full namename.namepersonName
Emailemail.emailAddressemailAddress
Phonetel.telephoneNumberphone
Street addressstreet-address.fullStreetAddresspostalAddress
Postcodepostal-code.postalCodepostalCode
New passwordnew-password.newPasswordnewPassword
SMS codeone-time-code.oneTimeCodesmsOTPCode

When testing autofill, check that values land in the right fields (no surname in the city field), that autofilled values pass validation (autofill sometimes adds a trailing space), and that floating labels don’t overlap the filled text.

Check this part

  1. The quantity field shows a number pad. Do you still need to test letters?

  2. What is the difference between a disabled and a read-only field?

  3. You fix the value in a field with an error. When should the error message go away?

Keyboard types, the states a field moves through, when errors should appear, and autofill that only works when fields say what they hold.

Part Not started

When to use it

A text field is the right choice when:

  • The answer is truly open: names, addresses, messages, search terms.
  • There are too many possible values to list (every email address in the world).
  • Users know the answer and typing is faster than scrolling (a postcode, a promo code).

Good and bad uses

A visible label above every field

Full name

Anna Kovač

Email

anna.kov

Phone

+385 91 234 5678

The label stays while you type, so you always know what the field is for.

Placeholder used as the label

Anna Kovačanna.kovPhone

Halfway through typing, which field is this? The hint vanished with the first letter. Placeholders also tend to have low contrastContrast ratioHow different text and background colors are; WCAG asks for at least 4.5:1 for normal text.Open in glossary → and are often skipped by screen readers.

Free text for free answers

Optional

Every answer is different, so a text field fits.

Free text for a fixed list

A typo and a trailing space, and now shipping can’t find the country. A known list belongs in a dropdown or a combo box.

One field that accepts any format

Paste works, spaces are fine, and the app removes them before checking.

Split into boxes

Card number

4111111111

Pasting the number fills only the first box, autofill breaks, and deleting jumps between boxes in surprising ways.

Check this part

  1. Why is a placeholder not a replacement for a label?

  2. Users must choose their country. Is a free text field a good choice?

Use a text field when the answer is truly open; give every field a visible label and don't use free text for a fixed list.

Part Not started

Common bugs

These are the text field bugs testers report again and again.

#BugWhat you seeTypical severitySeverityHow much damage a bug does to the product or the user.Open in glossary →
1Spaces break validationA valid email with a trailing space (from autofill or copy-paste) is rejectedHigh
2Error never clearsYou fix the value, but the red message stays until you submit againMedium
3Silent truncationA phone number or address is cut off at a hidden limit, with no messageHigh
4Wrong character countThe counter says “2/20” for one emoji, or a limit cuts an emoji in halfLow–Medium
5“Numeric” field accepts lettersA postcode, quantity or year accepts 19ab and saves itMedium
6Wrong keyboardEmail opens a keyboard with no @; a postcode opens lettersMedium
7Valid input rejectedO'Brien, Đurđa, anna+shop@test.com or a 2-letter surname is refusedHigh
8Input rendered as HTMLTyping <b>Anna</b> shows Anna in bold somewhere. A sign of an XSSCross-site scripting (XSS)An attack where text a user enters is run as code in other people's browsers.Open in glossary → holeCritical
9Broken charactersKovač is saved or shown as KovaÄ or Kova? (an encoding bug)Medium–High
10Paste blockedPaste does nothing in password or “confirm email” fieldsMedium
11Data lostText disappears after rotating, switching apps, or a failed submitHigh
12Keyboard hides the fieldThe field (or its error) is behind the on-screen keyboard and can’t be seenMedium

Stress-test it

This is where testers earn their money. Real users paste, autofill, use emoji and have names developers never imagined. Each input below is a classic negative testNegative testingTesting with invalid or unexpected input to check the software handles it gracefully.Open in glossary → or edge caseEdge caseAn unusual situation at the extreme of what the software should handle.Open in glossary →:

🧪 Input torture playground

Testers feed fields the inputs developers forget. Pick a test input (it is pasted into the field) or type your own, and see how a well-built field handles it.

Checkout details

Preview on next screen

Nothing valid to show yet
Typed / pasted
(nothing)
Length
0 characters
Result
Waiting for input…

Why testers try this

Pick a test input above. Each one targets a different kind of bug.

Find the bug

The plant shop sign-up below has six bugs. Test it like a pro:

  • Type valid data first, then invalid data.
  • Leave fields half-done and come back to fix them.
  • Use emoji, spaces and international formats.
  • Watch the keyboard, the profile preview and the network log.

🐞 Bug hunt: Bloom sign-up

This demo has 6 hidden bugs. Explore it like a tester, then check your findings.

Found0/6
9:41

Create account

Profile preview

Hi, there!

Display name0/30
Email
Phone
Year of birth
Password

Tip: the keyboard shows which type each field opens.

Network log

Create an account to see the request body…

  1. 1

    Hint: Leave the email field with a typo, then go back and fix it.

  2. 2

    Hint: Keyboards and autofill often add a space after the last word.

  3. 3

    Hint: Put emoji in the display name and watch the counter.

  4. 4

    Hint: Type the phone number in the format shown in the placeholder.

  5. 5

    Hint: Look at the keyboard for Year of birth, then try typing letters.

  6. 6

    Hint: Type a display name like <b>Anna</b> and watch the profile preview.

Check this part

  1. A valid email with a trailing space is rejected. What is the most likely cause?

  2. You type <b>Anna</b> as your name and the confirmation screen shows "Anna" in bold. How serious is this?

  3. Which inputs belong on your personal list of nasty test data?

Untrimmed spaces, stale errors, silent truncation, emoji counts, wrong keyboards, rejected valid names, input rendered as HTML and lost text.

Part Not started

How to test it

Start without any tools. Find a screen that uses this component and use it the way a real user would: slowly, then fast, then in ways nobody planned for. Tick off the checklist as you go. Most of it needs only your eyes and your fingers.

Then try the example test cases. Some of them need a little setup:

  • A slow or missing connection: switch on airplane mode, or slow the network down. See Network conditions.

New to this? Do the checklist first and skip any test case whose setup you don’t know yet.

Checklist

Text field test checklist

0 of 14 checked

Example test cases

TC-TXT-001Valid email is accepted

Steps

  1. Open the Sign-up screen
  2. Enter "anna@test.com" in Email
  3. Fill other fields with valid data
  4. Tap "Create account"

Expected result

No error is shown and the account is created with email "anna@test.com".

TC-TXT-002Email with surrounding spaces is trimmed

Steps

  1. Enter " anna@test.com " in Email (two spaces before and after)
  2. Move to the next field
  3. Tap "Create account"

Expected result

No error is shown. The saved / sent value is "anna@test.com" without spaces.

TC-TXT-003Error disappears once the value is fixed

Steps

  1. Enter "anna@test" in Email
  2. Move to the next field
  3. Go back and change the value to "anna@test.com"

Expected result

An error appears after step 2 and disappears as soon as the value becomes valid in step 3, without submitting.

TC-TXT-004Name accepts apostrophes and local letters

Steps

  1. Enter "Seán O'Brien" in Full name and save
  2. Repeat with "Đurđica Šćepanović" and "Јована Петровић"
  3. Reopen the profile

Expected result

All names are accepted and displayed exactly as entered on every screen and in emails.

TC-TXT-005Maximum length boundary

Preconditions

  • Display name limit is 30 characters

Steps

  1. Enter exactly 30 characters
  2. Enter 31 characters (type and paste)
  3. Enter 29 letters plus one emoji

Test data

30 chars: "Anna-Marie Kovač-Horvat Zagreb"

Expected result

30 characters are accepted. 31 shows a clear limit message and nothing is cut silently. 29 letters + 1 emoji counts as 30.

TC-TXT-006HTML is shown as plain text

Steps

  1. Enter "<b>Anna</b>" as Display name
  2. Save the profile
  3. View the name on the profile, in a review and in the order email

Expected result

The literal text "<b>Anna</b>" is shown everywhere. Nothing turns bold and no script runs.

TC-TXT-007Numeric field rejects pasted letters

Steps

  1. Focus Year of birth and check the keyboard
  2. Paste "19ab"
  3. Tap "Create account"

Expected result

A number pad opens. The letters are rejected or removed, and an error explains the expected format (e.g. "Enter a year like 1994").

TC-TXT-008Password show/hide keeps the value

Steps

  1. Type "Secret123!" in Password
  2. Tap the eye icon
  3. Tap it again
  4. Add "4" at the end

Expected result

The password is shown in plain text after step 2 and masked after step 3. The final value is "Secret123!4".

TC-TXT-009Typed text survives a failed submit

Preconditions

  • Device is offline

Steps

  1. Fill in all fields
  2. Tap "Create account"
  3. Dismiss the "No connection" error

Expected result

All entered values (except possibly the password, if the team decided so) are still in the fields.

Tip: click a test case to expand it.

Check this part

  1. A user rotates the phone while filling in a long delivery note. What should happen to the text?

  2. The name O'Brien is refused by a sign-up form. What is this?

A checklist and example test cases for labels, keyboards, trimming, limits, international input, errors, paste and kept text.

Part Not started

Accessibility

Text fields are where many users with disabilities get stuck. Check these:

Mobile vs web

Dev note
Native components: UITextField / UITextView (UIKit), TextField / TextEditor (SwiftUI).
  • Keyboard type, auto-capitalization, autocorrect and the autofill content type are set per field. Check all four.
    Dev note
    The autofill content type is textContentType.
  • Clear button (“x”) and secure entry (dots) are built in.
  • The keyboard can cover the field: scroll the form and check the focused field is visible.
  • Test Dynamic Type, dark mode and the Passwords autofill bar.
Dev note
Native component: EditText; with Material Design, TextInputLayout (filled or outlined) or TextField in Jetpack Compose.
  • Test the keyboard with Gboard and Samsung Keyboard, because they behave differently.
    Dev note
    The inputType controls the keyboard.
  • Floating labels: check they don’t overlap autofilled text or the prefix/suffix.
  • Check what happens after rotation and after the app is killed in the background: the text should survive.
  • Test with font scale, display size and TalkBack.
Dev note
HTML <input> with a type (email, tel, password, number, url, search) or <textarea>.
  • Number fields have quirks on the web: they accept the letter “e”, and in Chromium browsers the mouse wheel changes a focused value (see Stepper). Try both.
    Dev note
    That’s type="number". Many teams use inputmode="numeric" instead; know which one your app uses.
  • Use DevTools to check that the field has a label, says what it holds for autofill, and exposes its error to screen readers.
    Dev note
    The label, autocomplete, aria-invalid and aria-describedby attributes.
  • Test browser autofill in Chrome, Safari and Firefox, plus password managers.
  • Test on a phone browser too: the right keyboard has to appear there as well.
    Dev note
    It depends on type and inputmode.

Check this part

  1. A field shows an error with only a red border. What is missing?

  2. On the web, how can you quickly check that a field has a label connected to it?

A real connected label, announced errors that aren't color only, contrast, big text and autocomplete; then iOS, Android and web specifics.

Key takeaways

  • A text field accepts anything, so test far beyond the happy path: empty, spaces, long, emoji, accented letters, apostrophes, HTML and pasted text.
  • Every field needs a visible label. A placeholder is an example, not a label.
  • The input type decides the mobile keyboard and autofill, but it’s not validation.
  • Errors should appear at a sensible time, explain how to fix the value, and disappear once it’s fixed.
  • The classic bugs: untrimmed spaces, stale errors, silent truncation, wrong counts with emoji, wrong keyboards, valid names rejected, and input rendered as HTML.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.