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
Do: A reference in two boxes: a paste spreads across both
Sample to copy and paste. The button replaces what is in the field.
KP4-92X
Don't: A field that cancels paste
Don't: A mask that drops a paste it did not expect
Don't: Boxes that take a paste in the first box only
Sample to copy and paste. The button replaces what is in the field.
KP4-92X
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
maxLengthoff 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
autocompletevalue 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
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Supports | 3.3.8 Accessible Authentication (Minimum) |
| WCAG 2.2 | Law | Supports | 3.3.7 Redundant Entry |
| Material Design | Judge | No position | |
| Apple Human Interface Guidelines | Judge | No position | |
| Carbon Design System | Judge | No position | |
| GOV.UK Design System | Expert witness | Supports | Text input Recover from validation errors Character count |
| Nielsen Norman Group | Expert witness | Supports | A 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
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.