WordPress.org

Ideas

search - add title tag, make it WCAG 2 compliant / accessibility

  1. concertm
    Member

    12345

    The search form with no label for the search field is not W3C accessibilty compliant.

    To make it compliant for the upcoming WCAG 2 guidelines (links below), it simply needs a title tag added to the search field.

    file: /wp-includes/widgets.php

    in: function wp_widget_search($args) {

    change:

    <input type="text" name="s" id="s" size="15" />

    to:

    <input type="text" name="s" id="s" size="15"
    title="<?php echo attribute_escape(__('Search')); ?>" />

    which by default creates the HTML output:

    <input type="text" name="s" id="s" size="15" title="Search" />

    References:

    How to meet WCAG 2.0
    http://www.w3.org/WAI/WCAG20/quickref/20080430/

    Accessible Froms using WCAG 2.0
    http://www.usability.com.au/resources/wcag2/

    H65: Using the title attribute to identify form controls when the label element cannot be used
    http://www.w3.org/TR/WCAG20-TECHS/H65.html

    Questions: contact us at
    http://research.elabs.govt.nz

    Posted: 6 years ago #
  2. this is another theme related issue. All of it can be accomplished now with a correctly written theme and use of the plugins

    Posted: 6 years ago #
  3. concertm
    Member

    12345

    That is only partially correct. Theming has been introduced for the search form, but there is still default code that should be enhanced as described above.

    In WordPress 2.6.2
    wp-includes/widgets.php line 474

    Posted: 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    3 Votes
  • Status

    This idea has been implemented