Skip to content

FRM-017 Let every text field take a pasted value, and never cut it without saying so

Level
Guideline, our choice
Verdict
Insufficient evidence (0 of 3 judges spoke)
Area
Forms
Status
proposed, version 1.0.0

Rule

Outside sign-in, which FRM-008 covers, let every text field and text area take a pasted value. Never block a paste, and never cut or drop pasted characters without saying so. Removing separators from the value that is checked, as FRM-017a describes, is not such a change.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: A single line and a paragraph take the paste

Home insurance claim

Sample to copy and paste. The button replaces what is in the field.

  • HX-4471-0923
  • HX-4471-0923

Sample to copy and paste. The button replaces what is in the field.

  • The kitchen tap burst on Monday night. Water ran under the floor for about an hour before I found the stop valve.
Copy a sample and paste it with the keyboard or the pointer, or press Paste sample. The policy number arrives whole, hyphens and all, and so does the paragraph. The form gets the number with spaces at either end taken off, and the field keeps what was pasted.

Do: A reference in two boxes: a paste spreads across both

Booking reference

Sample to copy and paste. The button replaces what is in the field.

  • KP4-92X
Paste the sample into either box. The hyphen is dropped, the letters are folded to capitals, and the first three characters go in the first box and everything else in the second, so nothing is lost. A paste of three characters or fewer goes in as it is.

Don't: A field that cancels paste

Sample to copy and paste. The button replaces what is in the field.

  • 55820419
The handler cancels the paste, so nothing arrives and the readout says so. Press Paste sample or paste with the keyboard: the field stays empty, and the person has to read eight digits off another window and type them again.

Don't: A mask that drops a paste it did not expect

Sample to copy and paste. The button replaces what is in the field.

  • HX-4471-0923
  • HX44710923
The mask only knows letters and digits. A policy number pasted with its hyphens is dropped whole, with no message. Paste the second sample, which has no hyphens, and it goes in, so the person cannot tell what the field wants.

Don't: Boxes that take a paste in the first box only

Booking reference

Sample to copy and paste. The button replaces what is in the field.

  • KP4-92X
Each box holds three characters, and nothing spreads a paste. The sample lands in the first box, which keeps only its first three characters, and the second box stays empty. The form gets half a reference.

Why

People paste because retyping is slow and easy to get wrong. A policy number from an email, a reference from a letter or a paragraph drafted in another app reaches the field in one step and exactly as it was. When a field refuses the paste, the person has to read the value character by character and type it again, which is hardest for people with memory, reading or motor difficulties. When the page cuts or alters the paste out of sight, the field holds something the person did not give, and they have no reason to look.

WCAG requires paste only at sign-in. WCAG 2.2, 3.3.8 Accessible Authentication (Minimum) is FRM-008. Outside sign-in, this guideline is our choice and not a WCAG requirement. 3.3.7 Redundant Entry supports it loosely: pasting from an earlier screen is one way people cope with being asked for a value again.

Our reasons

No judge has spoken about paste outside sign-in, so the verdict is Insufficient evidence (0 of 3 judges spoke) and this guideline is our choice. GOV.UK and NN/g support it; they are expert witnesses who do not vote. We let every field take paste for four reasons.

  • The reason WCAG gives at sign-in holds everywhere. Copying spares people from holding a value in their head and typing it out. An account number or a booking reference is as long and as easy to mistype as a password.
  • Blocking paste does not make a value more correct. A person told to type a value again types it from the same place they would have copied it, and a typed copy is more likely to hold a slip than a pasted one.
  • A silent change is worse than a refusal. A refused paste is at least noticed. A paste that loses its last characters, or a few of its letters, looks right at a glance and is sent wrong.
  • It costs the product nothing. The page can still clean and check the value after it arrives (FRM-017a) and hold free text to a limit (FRM-017b and FRM-017c).

Do

  • On a home insurance claim form, Policy number is a plain <Input>. The person copies "HX-4471-0923" from their renewal email and pastes it, and it arrives whole.
  • What happened is a <Textarea>. A paragraph written earlier in a notes app goes in as pasted.
  • Booking reference is shown as two boxes of three characters, six in total. A paste of "KP4-92X" into either box spreads across both, as FRM-008 asks of code boxes at sign-in.
  • The field keeps what the person pasted. Spaces at either end and separators are removed only from the value that is checked and sent, as FRM-017a describes.
  • On a number or code field, leave maxLength off and check the length after cleaning, so a paste with spaces in it is never cut. FRM-017a says the same.
  • When a paste is longer than a free-text field allows, the field says so, as FRM-017c describes, and does not cut it in silence.
  • If a form asks for a value a second time anyway, such as Confirm account number, that field takes paste too. Whether to ask twice at all is FRM-009.
  • When an account is created, New password and Confirm new password take paste, so a password from a password manager can go in. FRM-008 leaves these fields out of its scope; this guideline asks that they take paste.
  • A rich text editor may paste as plain text and drop formatting. The result is in the editor, where the person can see and change it.

Don't

  • Put onPaste={(e) => e.preventDefault()} on Confirm account number so that people have to type it twice.
  • Wrap <Input> in a custom component that cancels paste to keep a mask intact.
  • Use a masking library that drops a pasted value because it has a space or a hyphen the mask does not expect.
  • Give What happened maxLength={500} with no count, so a 700-character paste keeps the first 500 and nothing says so.
  • Strip every character that is not a digit from a pasted policy number when letters are part of it, and send what is left.

Exceptions

  • Removing separators. Removing spaces, hyphens and other separators from the value that is checked, as FRM-017a describes, is not a change to the paste under this guideline.
  • Sign-in. Every step of signing in, and of getting back into an account, is FRM-008, which WCAG requires.
  • When typing is the task. A typing test, or an answer that only means something if the person types it, such as a spelling exercise, may refuse paste. Keep this to fields where the typing itself is what is being checked.
  • Filling by the browser. Filling a field from the browser or a password manager is a different route from paste and is covered by FRM-007.
  • A product that chooses otherwise. This is a guideline. A field that refuses paste still needs its visible label (FRM-001) and its autocomplete value where FRM-007 asks for one.

Verdict

Insufficient evidence (0 of 3 judges spoke). Only the judges decide; the expert witnesses are shown but do not vote. The judges do not settle this one, so it is a guideline: our own choice, with our reasons above. How verdicts work

Stances on FRM-017
SourceRoleStancePage
WCAG 2.2LawSupports3.3.8 Accessible Authentication (Minimum)
WCAG 2.2LawSupports3.3.7 Redundant Entry
Material DesignJudge No position
Apple Human Interface GuidelinesJudge No position
Carbon Design SystemJudge No position
GOV.UK Design SystemExpert witness SupportsText input
Recover from validation errors
Character count
Nielsen Norman GroupExpert witness SupportsA Checklist for Designing Mobile Input Fields, by Raluca Budiu

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Forms: 15 rules and 12 guidelines · All rules