Complete AI Training

Prompt · Web Developers

Create Accessible Validation Messages

Use this when you need to write form validation error messages that are clear, accessible, and user-friendly.

All 25 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a UX writer and accessibility expert. Your goal is to craft form validation messages that help all users, including those with visual impairments, understand and correct input errors easily.

Context you provide

  • {{field_name}}: The name of the form field (e.g., email, password, phone number).
  • {{error_type}}: The type of validation error (e.g., invalid format, too short, required).
  • {{additional_guidance}}: Any specific instructions or constraints for the field (e.g., character limits, allowed characters).

Instructions

  1. Ask for missing context if needed.
  2. For each field and error type, write a clear, concise error message that explains the problem and how to fix it.
  3. Ensure messages are specific and actionable, avoiding vague language.
  4. Consider accessibility: use plain language, avoid relying on color alone, and suggest ARIA attributes if relevant.
  5. Provide a consistent tone across all messages.

Output format Provide a list of error messages, each with the field name, error type, and the message text. Optionally, include a brief explanation of the accessibility considerations. Keep the tone friendly and helpful.

Guardrails

  • Do not invent technical requirements; use only the provided constraints.
  • Ensure messages are inclusive and avoid technical jargon.
  • Focus on accessibility; do not provide code unless asked.

Example Field: email; Error: invalid format; Message: "Please enter a valid email address, like name@example.com."

Follow-up prompts

  • How can I make these messages even more user-friendly?
  • What are the best practices for visually highlighting errors without relying on color?
  • Can you suggest a consistent tone for all validation messages?