When the fix is known, say it: show the format, the valid options or the next open slot. Examples from reservations and lookups.
Telling someone a field is wrong is only half the job. WCAG 2.1 success criterion 3.3.3 (Level AA) says that if an input error is automatically detected and suggestions for correction are known, the suggestions are provided to the user, unless that would jeopardize the security or purpose of the content.
The key words are "are known". If the site knows the field needs five digits, or that the only valid options are three time slots, it should say so. Suggestions can come from the author or from the user agent. They help people with cognitive disabilities, low vision and motor impairments to fix the error with fewer attempts, and they reduce abandoned forms.
Residents use public forms to book, pay, apply and report. "Invalid entry" on a park reservation or a license renewal sends them back to guess. DOJ's guidance lists unclear instructions and missing error alerts among the barriers on forms; a message that says how to fix a problem is one way to give clear instructions. See also mobile apps, where small keyboards make retyping costly.
<p class="error" id="zip-err">Invalid ZIP.</p><p class="error" id="zip-err">
ZIP code: enter 5 digits, for example 94103. You entered 4.
</p><p class="error">Date error.</p><p class="error">
Check-out must be after check-in (June 14).
<button type="button" data-set="checkout" data-value="2026-06-15">Use June 15</button>
</p><p class="error">That time is not available.</p><p class="error">9:00 AM is full. Available times on this day:</p>
<ul>
<li><button type="button" data-time="09:30">9:30 AM</button></li>
<li><button type="button" data-time="10:15">10:15 AM</button></li>
</ul>// SwiftUI
if zip.count != 5 { Text("Invalid ZIP").foregroundColor(.red) }// SwiftUI
if zip.count != 5 {
Text("ZIP code: enter 5 digits. You entered \(zip.count).")
.foregroundColor(.red)
}// Jetpack Compose
OutlinedTextField(
value = zip, onValueChange = { zip = it },
isError = zip.length != 5,
supportingText = { if (zip.length != 5) Text("Invalid ZIP") }
)// Jetpack Compose
OutlinedTextField(
value = zip, onValueChange = { zip = it },
isError = zip.length != 5,
supportingText = {
if (zip.length != 5) Text("ZIP code: enter 5 digits. You entered ${zip.length}.")
}
)