Has anyone ever tried implementing this in Drupal?
http://www.w3.org/TR/WCAG20-TECHS/G83
Specifically, I'm looking at adding an error message to the page title:
It is also best practice to include an error notification in the page title (title element) since a screen reader user is likely to believe the page was submitted correctly and continue to navigate to another page as soon as the new page is returned instead of reading the main content area of the page again.
I'm interested in knowing if anyone has tried this before, if there are any modules that would allow one to do this, or if there are any recommended techniques for achieving this.
I find the default position of Drupal error messages often ends up fairly hidden in a page, so I'd also be interested to know if anyone has moved this error to a more obvious position (say, fixed to the top of the screen).
Comments
Daniel Thanks for the
Daniel
Thanks for the question. I'm curious if you are most experienced with Drupal 6 or 7?
I am not sure that there are any modules that will do what you are looking for, change page title on a form validation error. You could do this using a custom module.
Speaking as a screen-reader user, however, I don't know that I find your proposal necessary. If a screen-reader user doesn't verify that there form was submitted correctly then they are at error as the user.
Nevertheless, you are correct about Drupal messages being difficult to locate, especially in Drupal 6. In Drupal 7 the Drupal messages have been themed to include a h2 of the message type directly prior to the messages, which improves the situation somewhat.
You may wish to see these related issues:
Allow forms to set custom validation error messages on required fields
WCAG violation: Relying on a color by itself to indicate a field validation error
Accessibility Consultant & Web Developer - Zufelt.ca
@ezufelt on Twitter | LinkedIn profile
For those one ending up here from a research on Google
We had exactly the same problem on one of our customer's site and @DeFr found a way to simply implement that in template.php in your theme :
/**
* Implements hook_process_html().
*/
function mytheme_process_html(&$vars) {
if (form_get_errors()) {
$vars['head_title'] .= ' - Error on this page';
}
}
Hope that helps some people to make theit websites more and more accessible.
BTW, thank you everyone in this group for your dedicated hard work