Skip to Main Content
Sustainable Web Design Logo
  • Home
  • Guidelines
  • Emissions
  • Ratings
  • Contact

◂ Web Development guidelines

3.11 Validate Form Errors and External Input

Web Development

Entering information on a page can lead to problems. If a visitor makes a mistake along the way, it makes good sense to have systems in place to guide them through resolving the typos, confusion, and glitches that can occur which lead to abandonment and extra emissions through wasted device usage.

Criteria

  • Error Validation: Errors are identified through live validation as well as upon submission.
  • Label Elements: Required elements are clearly identified and labeled (for the benefit of voice tools such as screen readers and virtual assistants), and optional elements (if unnecessary) removed.
  • Allow Paste: Always allow the pasting of content (including passwords) from external sources.

Impact

Medium

Effort

Low

Benefits

  • Security:
    Allowing people to correct mistakes (and identifying errors early in the input process) on forms before submission can avoid costly mistakes during financial transactions and spend less time being wasted on tasks.
  • Performance:
    Being able to fill in a form while addressing issues quickly reduces the barrier to entry and thereby avoids potentially having to refill a form or waste time going back and scrolling.
  • Economic:
    Shopping cart abandonment happens when errors occur, fixing issues upfront can reduce such potential issues.

GRI

  • materials: Medium
  • energy: Medium
  • water: Medium
  • emissions: Medium

Example

  • Code:
    <label for="username">Username: (3-16 characters)</label>
    <input name="username" type="text" value="Sasha" pattern="w{3,16}" required>
    <label for="pin">PIN: (4 digits)</label>
    <input name="pin" type="password" pattern="d{4,4}" required>
  • HTML attribute: pattern.

Resources

  • 48 Cart Abandonment Rate Statistics 2023
  • Client-side form validation
  • Data Validation
  • [GPFEDS] 4.10 – UX and UI (Input Format) (PDF)
  • How GDPR Will Change The Way You Develop
  • HTML attribute: required
  • Let them paste passwords
  • The “Cobra Effect” that is disabling paste on password fields
  • The Label element
  • United Nations [SDGS] Goal 1 (Poverty)
  • WCAG 2.2 Understanding Docs: Error Identification
  • Validating Input
  • Web Form Validation: Best Practices and Tutorials

View the Guideline

Tags

AccessibilityCompatibilityUIUsabilityHTMLSecurity

Share

More web development guidelines

3.1 Identify Relevant Technical Indicators

Web Development

3.2 Minify Your HTML, CSS, and JavaScript

Web Development

3.3 Use Code-Splitting Within Projects

Web Development

Learn about W3C’s Sustainable Web Interest Group:

A global community advancing sustainability on the web.

Explore the group

This site is brought to you by

Mightybytes Wholegrain Digital
Website Carbon

This page loaded in 0.25 seconds and emitted just 0.5g of CO2

Visit Website Carbon
Ecograder

How green is your website?

Visit Ecograder
© Copyright Sustainable Web Design 2025. Privacy Policy.