Autocapitalize, spellcheck, and enterkeyhint influence input assistance without defining which values are valid.
HTML text input assistance: keyboard hints are not validation
Why this choice matters
A technician enters an exact device serial and a free-text note. Automatic capitalization or spelling changes could corrupt the serial, while spellcheck may help with the note. The note's virtual-keyboard action can suggest sending, but the real submit button remains visible. These hints vary across browsers and input methods; a physical keyboard may ignore them. The server validates the serial against a record rather than trusting any keyboard behavior.
<form action="/devices/lookup" method="post">
<label for="device-serial">Device serial</label>
<input id="device-serial" name="serial" autocapitalize="off" spellcheck="false" required>
<label for="device-note">Technician note</label>
<textarea id="device-note" name="note" spellcheck="true" enterkeyhint="done"></textarea>
<button type="submit">Check device</button>
</form>What it does not do
The browser may ignore a hint, and none of these attributes blocks pasted or programmatically submitted text. A live form should preserve the typed value after a server error.
Cost and operational limits
Native hints cost a few bytes and no dependency. The failure cost is subtle data corruption if a serial is silently changed or if a team assumes the keyboard action replaces a visible submit control.
Common Mistakes
- Do not treat autocapitalize=off as normalization.
- Do not hide the submit button because enterkeyhint is present.
- Do not enable spell correction for exact identifiers.
