WebAIM - Web Accessibility In Mind

E-mail List Archives

WCAG – Form fields and focus reset after JavaScript jump menu

for

From: Maupin, Brennan Polaris McCaffrey - maupinbp
Date: Mar 5, 2019 7:43AM


Hi all,

Hi all, I have a quick question about a website that I am looking over and wanted to see if someone could point me in the right direction.

This website uses a number of drop-down forms to reserve a room and two of them have JavaScript functions attached to dynamically control the drop-down options further down on the page (very much like WCAG SCR19-Using an onchange event on a select element without causing a change of context<https://www.w3.org/WAI/WCAG21/Techniques/client-side-script/SCR19>).

My issue with these JS functions is that sometimes when they are triggered (like if I go back and correct an earlier form,) when I press tab again, they seem to "reset" the focus back to the topmost form field.

I can see how if it *automatically* changed focus it would definitely be violating 3.2.2, but I am not sure since there is no actual shift of focus until I press tab myself. Does anyone know if this compliant with WCAG or not?

Thanks so much,
Brennan