Files
notifications-admin/app/assets/javascripts/main.js
Chris Hill-Scott 0d12714401 Automatically focus the first form field error
Because we’re not showing a summary of error messages screen reader users might
take a while to discover that there’s an error on the page. Since the only
real action on a page with errors is to correct them this commit adds some
Javascript to send focus straight to the first error message on a page.
2016-02-23 07:29:51 +00:00

6 lines
203 B
JavaScript

$(() => GOVUK.modules.start());
$(() => new GOVUK.SelectionButtons('.block-label input, .sms-message-option input'));
$(() => $('.error-message').eq(0).parent('label').next('input').trigger('focus'));