{"id":106,"date":"2026-05-07T06:31:00","date_gmt":"2026-05-07T01:01:00","guid":{"rendered":"https:\/\/wpcustom.co\/?p=106"},"modified":"2026-05-07T06:30:53","modified_gmt":"2026-05-07T01:00:53","slug":"accessible-collapsible-forms","status":"publish","type":"post","link":"https:\/\/wpcustom.co\/blog\/accessible-collapsible-forms\/","title":{"rendered":"Accessible Collapsible Forms in WordPress: Doing It Right (ARIA, Keyboard, Screen Readers)"},"content":{"rendered":"<p>Collapsible form sections are one of those features that look simple on the surface and get genuinely hard underneath. The clicking and the animating are easy. Making the result actually usable for people who navigate with a keyboard, a screen reader, or a switch device is where most implementations quietly fall apart.<\/p>\n<p>This guide covers what accessibility means specifically for collapsible form sections, and what to build or check for so your forms work for every visitor, not just the ones using a mouse.<\/p>\n<h2>Why This Matters Beyond Compliance<\/h2>\n<p>Accessibility is often framed as a legal box to tick. That framing misses two practical points.<\/p>\n<p>First, the same patterns that help disabled users help everyone. Clear focus indicators, predictable keyboard behavior, and meaningful labels make forms easier for distracted users on phones, users in noisy environments, and users on bad internet who cannot wait for animations to settle.<\/p>\n<p>Second, the legal pressure is real and growing. Accessibility lawsuits in the US have risen sharply year over year, and the EU&#8217;s Accessibility Act now applies to a wide range of digital products. A form that quietly excludes 15 percent of your audience is also a form that exposes the business to risk.<\/p>\n<h2>The Three Pillars of an Accessible Collapsible Section<\/h2>\n<p>Every collapsible section in a form needs to handle three things correctly:<\/p>\n<ol>\n<li><strong>Keyboard navigation:<\/strong> the visitor can reach, open, and close the section using only Tab, Enter, and Space.<\/li>\n<li><strong>Screen reader announcements:<\/strong> assistive technology correctly announces &#8220;expanded&#8221; or &#8220;collapsed&#8221; when the state changes.<\/li>\n<li><strong>Focus management:<\/strong> when a section opens, focus stays in a sensible place, and validation errors do not get hidden inside collapsed sections.<\/li>\n<\/ol>\n<p>Get those three right and you have an accessible component. Miss any one and you have a broken one.<\/p>\n<h2>Pillar 1: Keyboard Navigation<\/h2>\n<p>The clickable heading of each section needs to behave like a button, not a styled <code>div<\/code>. That means three things:<\/p>\n<ul>\n<li>It is reachable by Tab. If you used a <code>div<\/code>, add <code>tabindex=\"0\"<\/code>. Better, use an actual <code>&lt;button&gt;<\/code> element and skip the workaround.<\/li>\n<li>It activates on both Enter and Space. If you used <code>&lt;button&gt;<\/code>, this is automatic. If you used a <code>div<\/code>, you have to write key event handlers yourself, and most implementations forget Space.<\/li>\n<li>It shows a visible focus ring. Removing the default browser focus outline without replacing it is one of the most common accessibility failures on the web.<\/li>\n<\/ul>\n<p>If you are working with a forms plugin, test this by tabbing through the form without a mouse. If you cannot reach a section heading or activate it with the keyboard, the implementation is broken.<\/p>\n<h2>Pillar 2: Screen Reader Announcements<\/h2>\n<p>This is where the <code>aria-expanded<\/code> attribute earns its keep. The attribute sits on the section&#8217;s button or heading, and its value flips between <code>true<\/code> and <code>false<\/code> as the section opens and closes.<\/p>\n<p><code>&lt;button aria-expanded=\"false\" aria-controls=\"section-1-content\"&gt;Section Title&lt;\/button&gt;<\/code><\/p>\n<p>Two things matter here:<\/p>\n<ul>\n<li>The value must actually update when the section opens or closes. A surprising number of implementations set it once and never change it.<\/li>\n<li>The <code>aria-controls<\/code> attribute should point to the ID of the panel being controlled, so screen readers can navigate to the content directly.<\/li>\n<\/ul>\n<p>Test with a real screen reader: VoiceOver on Mac, NVDA on Windows (it is free), or TalkBack on Android. When you focus a collapsible section heading, it should announce something like &#8220;Personal details, button, collapsed.&#8221; When you activate it, the announcement should change to &#8220;expanded.&#8221;<\/p>\n<h2>Pillar 3: Focus Management on Open and Submit<\/h2>\n<p>This is the subtle one, and the one most plugins miss.<\/p>\n<p><strong>When a section opens,<\/strong> focus should usually stay on the heading the user just clicked. Do not jump focus into the first input automatically. Some users want to read the section&#8217;s contents first, and a forced focus shift surprises them.<\/p>\n<p><strong>When the form is submitted with errors inside a collapsed section,<\/strong> two things must happen: the section must auto-expand to reveal the invalid field, and focus must move to that invalid field, not to the top of the form. Otherwise the visitor is left staring at a &#8220;form has errors&#8221; message with no idea where the error actually is.<\/p>\n<p>This is one of the most important behaviors for long forms. Visitors give up at this stage if they cannot find the problem. Our broader guide on <a href=\"https:\/\/wpcustom.co\/blog\/reduce-form-abandonment\/\">reducing form abandonment<\/a> goes deeper on validation behavior and why getting it right matters so much for completion rates.<\/p>\n<h2>Common Failures in Popular Plugins<\/h2>\n<p>Across the major form plugins, the accessibility implementation of collapsible sections varies. None of them are catastrophic, but none of them are perfect either.<\/p>\n<p>Fluent Forms gets keyboard navigation right but has weaker screen reader announcements out of the box. Gravity Forms with the JetSloth Collapsible Sections add-on handles announcements better but needs CSS work to make focus indicators visible. Formidable&#8217;s native implementation falls in between.<\/p>\n<p>If accessibility is a hard requirement, do not assume the plugin handles it. Test with a screen reader and a keyboard before signing off. Our <a href=\"https:\/\/wpcustom.co\/blog\/collapsible-sections-form-plugins-compared\/\">comparison of these three plugins<\/a> covers the broader feature trade-offs.<\/p>\n<h2>The Native HTML Option<\/h2>\n<p>One often-overlooked path: the HTML <code>&lt;details&gt;<\/code> and <code>&lt;summary&gt;<\/code> elements. Browsers handle keyboard navigation, focus, and the basic open and close announcement natively. You write less code, and the result is usually more accessible than a custom implementation.<\/p>\n<p>The trade-off: you lose some styling control, and not every form plugin lets you wrap fields in a custom HTML element cleanly. For lean WordPress installations, this is often the right choice. For complex forms with conditional logic, the plugin route remains better.<\/p>\n<h2>When You Need It Built Properly<\/h2>\n<p>If you operate in a regulated industry (healthcare, government, financial services) or your audience includes a meaningful population of assistive tech users, getting accessibility right is not optional. The cost of doing it wrong (both in user trust and in legal exposure) is far greater than the cost of doing it right from the start.<\/p>\n<p>For UK-based businesses where accessibility compliance under the Public Sector Bodies Accessibility Regulations or the Equality Act is part of the requirement, <a href=\"https:\/\/wpcustom.co\/wordpress-customisation-united-kingdom\/\">bespoke WordPress development in the UK<\/a> from WPCustom includes accessibility as a baseline, not an add-on. The work covers ARIA implementation, keyboard navigation, focus management, and screen reader testing on every interactive component, including forms with collapsible sections.<\/p>\n<h2>A Final Checklist<\/h2>\n<p>Before you ship a form with collapsible sections, run this checklist:<\/p>\n<ul>\n<li>Can you reach every section heading with Tab alone?<\/li>\n<li>Can you open and close every section with both Enter and Space?<\/li>\n<li>Is the focus ring clearly visible on every interactive element?<\/li>\n<li>Does <code>aria-expanded<\/code> change between <code>true<\/code> and <code>false<\/code> as you toggle?<\/li>\n<li>Does a screen reader announce the state change?<\/li>\n<li>If you submit with errors in a collapsed section, does the section auto-expand and focus jump to the invalid field?<\/li>\n<li>Does the form work with the browser zoomed to 200 percent?<\/li>\n<\/ul>\n<p>If you can check off all seven, your collapsible form is accessible. If you cannot, you know where to start. And if you have not yet decided how to add collapsible sections in the first place, our pillar guide on <a href=\"https:\/\/wpcustom.co\/blog\/collapsible-info-wordpress-forms\/\">adding collapsible info to WordPress forms<\/a> walks through the four main approaches and which fits which kind of build.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Discover best practices for building accessible collapsible forms in WordPress. This guide covers ARIA labels, keyboard accessibility, screen reader compatibility, and user-friendly form design.<\/p>\n","protected":false},"author":1,"featured_media":71,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[44,41,40],"class_list":["post-106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-forms","tag-accessibility","tag-collapsible-sections","tag-wordpress-forms"],"_links":{"self":[{"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":2,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":119,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/posts\/106\/revisions\/119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/media\/71"}],"wp:attachment":[{"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcustom.co\/blog\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}