formsVercel
Trim Text Expansions
MUST
MUST: Trim values to handle text expansion trailing spaces
Trim input values so invisible whitespace never fails validation
Bad
Good
Why it matters
Autocorrect, keyboard text-expansion snippets, password managers, and copy-paste from a spreadsheet all routinely append a trailing space. The value looks correct on screen, so when validation rejects it the user is told their own email or coupon code is invalid with nothing visibly wrong — an error with no discoverable fix. Trim before validating. Prefer trimming on blur or submit rather than on every keystroke, so you do not delete a space the moment a user legitimately types one.