skip to content

A patient portal added input masks to its phone and insurance-ID text fields, and form completion dropped; what do masks break, and what would you specify instead?

level: seniorimportance: should knowfreq 38%

answer

  1. what happens on paste
  2. the caret and the backspace
  3. one format, many real values
  4. symbols read aloud as value
  5. be liberal in what you accept

basics

~20 s

Strict masks reject or garble pasted and autofilled values, fight caret movement and deletion, assume one format that real values break, and can be read aloud as symbols. Specify lenient input, silent normalisation, and a format example in helper text.

solid answer

~50 s

An **input mask** forces typed characters into a fixed template, inserting brackets and dashes and blocking anything else. Completion drops because the mask fights real input: a patient pastes '+44 20 7946 0000' and the mask rejects the plus or doubles the separators; a stored autofill value arrives in another format; typing mid-value makes the caret jump past inserted literals; backspace sticks on a dash; an insurer's ID has a letter the mask forbids. A screen reader may read the template's underscores and brackets as if they were the value. I would specify the opposite: accept any reasonable input, strip spaces, dashes and brackets silently, validate the normalised value, put a visible example in helper text, and give a specific error only when the digits themselves are wrong. Display grouping after the field is left is fine if it never changes what the person must type.

go deeper

for a junior

Know that an input mask forces a fixed template and that paste, autofill and non-standard values are where it tends to break.

for a middle

Explain the difference between a restrictive mask, display formatting and a format hint, and why normalising separators before validation removes most of the pain.

for a senior

Show how you would diagnose a completion drop to the mask with funnel data and reproduction paths, then specify a lenient field and measure recovery.

for a principal

Set a library-wide stance on masking, with a documented exception process, so product teams stop adding restrictive formatters one form at a time.

## Three things teams call 'a mask' The word covers three designs with very different costs, and the diagnosis starts by knowing which one shipped. | Technique | What it does | Typical cost | |---|---|---| | **Restrictive input mask** | Forces each keystroke into a fixed template, inserts literals, blocks other characters | High: breaks paste, autofill, editing and non-standard values | | **Display formatting** | Leaves typing free, then groups the value for readability after the field is left | Low, if it never rejects what was typed | | **Format hint** | Shows an example in helper text; accepts any reasonable input | Near zero | A drop in completion after 'adding masks' almost always means the first kind. ## How restrictive masks fail real users - **Paste.** A patient copies a number from a letter or email that already has spaces or a country code. The mask rejects characters it did not expect, or keeps its own separators and the pasted ones, producing garbage. - **Autofill.** The device's saved phone number or address arrives in its stored format. A mask that reformats keystrokes can mangle a value inserted all at once. - **Caret and deletion.** Inserted literals move the caret unexpectedly, editing a digit in the middle can shift everything after it, and backspace can stall on a dash the person never typed. - **One format assumed.** A national phone template cannot hold an international number; an insurance ID template written for one insurer rejects another insurer's letters or length. The mask encodes a guess about the data as a hard rule. - **Screen readers.** The template's underscores, brackets and dashes may be read out as if they were the field's value, and each inserted literal can produce confusing echoes. - **It looks filled.** A box full of template characters can read as already answered. ## Diagnosing the drop 1. Find where people abandon or fail: which field, which error, which device class. 2. Reproduce the four classic paths: paste a formatted value, accept an autofill suggestion, edit a digit in the middle, enter an international or non-standard value. 3. Walk the field with a screen reader and with the platform's text-size setting enlarged. 4. Run a few usability sessions with the real population; for a hospital portal that includes older patients and carers entering someone else's details. In a hospital portal the cost is not only a lost form. A patient who cannot enter an insurance ID phones the front desk instead, and a phone number the mask reformatted wrongly means appointment reminders that never arrive. ## What to specify instead 1. **Accept liberally.** Allow digits, spaces, dashes, brackets and a leading plus in a phone field; allow letters where any real ID can hold them. 2. **Normalise silently.** Strip separators before validating and storing; never make the person do the machine's cleanup. 3. **Validate the normalised value**, and word errors about what is actually wrong: 'This number is too short' rather than 'Invalid format'. 4. **Show the format in helper text**, with a real example, so it stays visible while typing. 5. **Size the field to the expected length**, which quietly signals how much is wanted. 6. **Format for display only after the field is left**, and only if the formatted value is still accepted if edited or pasted back. The principle is old: be liberal in what you accept and strict in what you store. The strictness moves from the keyboard to the validator, where it can be precise. ## When a mask can earn its place Display grouping helps people check long digit strings, such as grouping a long number into blocks of four, because chunking aids reading. A restrictive mask is least harmful when the value is truly fixed-length, universally formatted, digits only, and rarely pasted. Even then, test paste, autofill and assistive technology before shipping, and treat 'masks are never allowed' as a strong default rather than a law. ## Across platforms Web and native mobile components both offer formatter hooks that can act as masks, and the failure modes are the same on each: the formatter runs on every change and fights the person. A cross-platform spec should describe the behaviour, accept, normalise, hint, validate, rather than name one platform's formatter.

  • Would splitting the phone number into three short boxes that auto-advance fix the mask problems?
    Usually it makes them worse. Pasting a whole number into the first box fails or overflows, auto-advancing focus surprises people who look at the keyboard while typing, correcting a digit means moving between boxes, and international numbers still do not fit. One field with lenient parsing is simpler for everyone.
  • How would you prove the replacement spec actually recovered completion?
    Compare the same funnel before and after: completion rate for the form, error rate and correction count per field, and abandonment at those fields, segmented by device. Pair it with a few moderated sessions to catch failures the numbers hide, such as patients giving up and calling the hospital instead.

saying these in an interview costs you the question

  • Masks always improve data quality, so the completion drop must be user error.
  • Putting the format in the placeholder solves the problem the mask was solving.
  • Splitting a number into several auto-advancing boxes is the accessible alternative.
  • The server can trust any value that got past a front-end mask.
  • If the mask matches the national format, international patients are an edge case to ignore.