Skip to content
easeweb
Search topics

Dropdowns and fields that change the page on their own

A sort menu reloads the page as soon as its value changes, and a date field pulls focus into its calendar the moment it is focused.

WCAG 2.2
SC 3.2.1ASC 3.2.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <select onchange="this.form.submit()">
The accessibility problem illustrated: Motor:Why did the page reload?
01

The problem

Keyboard and screen reader users are sent away, or pulled ahead, before they have chosen anything

02

Try it

Change a field with the keyboard, and watch where focus goes

  • Broken 1: press ↓ in Sort by and watch where focus goes.

  • Broken 2: Tab to Delivery date, then press Shift+Tab to go back to Name.

  • Apply a fix. Try the same keys again. Does focus stay on the field you are using?

Broken Can you fix this?

Pens

  • Fineliner
  • Gel pen
  • Brush pen
  • Fountain pen

Focus is on: not in the page yet

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Change the page only when people ask for it

Before

A sort menu that reloads on change

<form action="/pens" method="get">  <label for="sort">Sort by</label>  <select id="sort" name="sort" onchange="this.form.submit()">    <option value="popular">Most popular</option>    <option value="name">Name, A to Z</option>    <option value="new">Newest</option>  </select></form>
What is wrong3 points
  • Keyboard users can't look through the options. Every new value submits the form, so the page reloads before anyone has chosen.
  • One arrow press is enough to set it off. A keyboard makes a new value at each arrow press, so the first arrow press already reloads the page.
  • People lose their place. The reload puts focus back at the top of the page.
After

A button that applies the choice

<form action="/pens" method="get">  <label for="sort">Sort by</label>  <select id="sort" name="sort">    <option value="popular">Most popular</option>    <option value="name">Name, A to Z</option>    <option value="new">Newest</option>  </select>  <button type="submit">Sort</button></form> <label for="date">Delivery date</label><p id="date-format">For example, 2026-12-14</p><input id="date" name="date" aria-describedby="date-format"><button type="button" id="date-button"  aria-expanded="false" aria-controls="calendar">Choose date</button>
How it is fixed3 steps
  1. Take onchange off the select and add a Sort button. The page reloads only when someone presses Sort.
  2. Take onfocus off the date field and add a Choose date button. The calendar opens, taking focus, only when someone presses it.
  3. Show the date format under the label and link it to the field with aria-describedby. The field accepts a typed date, so the calendar is a help, not the only way in.

This fixes both Befores and passes 3.2.1 and 3.2.2: the select and the field do nothing by themselves, and both changes are ones people asked for. It depends on the calendar's own script: choosing a day fills the field, and choosing a day or pressing Escape closes the calendar and returns focus to Choose date.

04

Verify the fix

5 checks, no mouse.

Test with: Keyboard, Screen reader, Zoom

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared form or filter components change.

How screen readers handle role="status", aria-describedby and aria-expanded

Limits

This is a starting pattern, not a guarantee for every application. Browsers differ in when they fire change from the keyboard: some change a closed select's value with every arrow press, others open the list and change the value only when a choice is confirmed. Test with the platforms your users have, and with the components your site really uses.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service