Skip to content

DigitalA11Y

Your Accessibility Partner

  • Home
  • ServicesExpand
    • WCAG Audit Services
    • VPAT/ACR Services
    • Accessibility Consulting
    • PDF Remediation
    • Accessibility Trainings
    • Website Remediation
    • Design Audit
  • Free ToolsExpand
    • Accessibility Checker
    • A11Y Cost Calculator
    • A11Y Bookmarklets
    • Color Contrast Extension
    • WCAG Contrast Checker
  • ResourcesExpand
    • A11Y Articles
    • WCAG Primer
    • ARIA Cheatsheet
    • A11Y Tools
    • A11Y Patterns
    • A11Y Cheatsheets
  • Contact
Search
DigitalA11Y
Your Accessibility Partner
Search

Generally Bad Form

Even in technically fully valid forms, there can be a lot messed up semantically, making it hardly accessible in many ways. Be it missing or improperly implemented elements – here we show the most common problems and explain them.

Most accessibility problems regarding form are caused due to bad semantics. So if you haven’t done this yet, go back and read Semantics and their importance for accessibility.

The following example shows a basic form that is technically perfectly valid HTML code.

Working Example

Gender
Male
Female
Submit

Explanation

But it lacks a lot of standard features needed for setting elements in relationship with each other properly and triggering browser standard functionality.

Although this visually clearly is a form, the controls aren’t surrounded by a <form> tag. This results in a form not submittable by hitting the Enter key (while focusing a control). Not really an accessibility problem, but still very annoying to power users (if you haven’t done this yet, go back and read Controlling a computer with a keyboard only).

Especially when doing fancy stuff with JavaScript, <form> tags often are forgotten, as developers are messing around with onclick events or similar. But please: whenever form controls need to be submittable, they should be placed in a <form> tag.

Code

  • HTML
  • CSS
  • JavaScript
<div class="control">
  <label>Full name</label><input type="text" />
</div>
<div class="control">
  <label>Biography</label><textarea></textarea>
</div>
<div class="fieldset">
  <div class="legend">
    Gender
  </div>
  <div class="control">
    <input name="gender" type="radio" value="male" />
    <div class="label">
      Male
    </div>
  </div>
  <div class="control">
    <input name="gender" type="radio" value="female" />
    <div class="label">
      Female
    </div>
  </div>
</div>
<a id="button" onclick="alert(&#39;Submitting using fancy JavaScript...&#39;)">Submit</a>
.control, .fieldset {
  margin: 6px 0;
}

label, .label {
  display: inline-block;
  width: 120px;
  vertical-align: top;
}

.fieldset {
  position: relative;
  border: 2px groove threedface;
  padding: 10px;
}

.legend {
  background-color: #fff;
  position: absolute;
  left: 10px;
  top: -12px;
  padding: 2px;
}

#button {
  padding: 2px 6px;
  border-width: 2px;
  border-style: outset;
  border-color: threedface;
}
#button:hover {
  cursor: default;
}
NIL

Company

  • About
  • Blog
  • Careers
  • Contact

Services

  • Accessibility Audits
  • Accessibility Consulting
  • VPAT/ACR
  • Accessibility Trainings

Compliance

  • WCAG
  • ADA
  • Section 508
  • EN 301 549
  • EAA
  • AODA
  • ACA

Resources

  • Accessibility Resources
  • Understanding WCAG
  • WCAG Checklist
  • Understanding WAI-ARIA

Legal

  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • Accessibility Statement for digitala11y.com
  • Sitemap

© 2025 DigitalA11Y
All Rights Reserved

Linkedin Twitter Facebook Instagram YouTube

DigitalA11Y
Plot No 108, 3rd Cross Rd, Saipuri Colony,
Hastinapuri Colony, Sainikpuri, Secunderabad -500094
Telangana, India.

Tel:(+91)99082 66680,
E-mail: [email protected]

Scroll to top
  • Home
  • Services
    • WCAG Audit Services
    • VPAT/ACR Services
    • Accessibility Consulting
    • PDF Remediation
    • Accessibility Trainings
    • Website Remediation
    • Design Audit
  • Free Tools
    • Accessibility Checker
    • A11Y Cost Calculator
    • A11Y Bookmarklets
    • Color Contrast Extension
    • WCAG Contrast Checker
  • Resources
    • A11Y Articles
    • WCAG Primer
    • ARIA Cheatsheet
    • A11Y Tools
    • A11Y Patterns
    • A11Y Cheatsheets
  • Contact