Search box and advanced search accessibility

If you try to validate a Drupal site using an automated accessibility validation tool you will get two kinds of errors related to the search box and advanced search form.

  1. WCAG 1.0 Checkpoint 12.4: Associate labels explicitly with their controls"
  2. WCAG 1.0 checkpoint 10.4: include default place-holding characters in edit boxes and text areas

To solve this issues you need to modify these files:

  • Modules/search.module
  • Modules/node.module
  • The css of your theme (optional)

Modifying the basic search box

The solution for the label element mising is trivial. The label is missing because Drupal place the label element only if is set the #tile in the form array, so you must change function search_box in search module inserting the #title:

function search_box($form_id = 'search_theme_form') {
// Use search_keys instead of keys to avoid ID conflicts with the search block.
$form[$form_id .'_keys'] = array(
'#title' => t('Search this site'),
'#type' => 'textfield',
'#size' => 15,
'#default_value' => '',
'#attributes' => array('title' => t('Enter the terms you wish to search for.')),

To be continued...

A search box appears in the

A search box appears in the left column for all users with search access . A search page that includes advanced search options is also available at http://domain-name/search.
To perform a search, simply enter the desired text and click Search: Drupal will look for nodes that contain all of the words you specify, in any order.
*The text you searched for
*A link that reveals controls for advanced searches
*A short snippet from each hit, with the sought-after term highlighted
*Other information about the node that contains the hit

To see the full node, click the hit's title—in this case, "Welcome to the Sunrader enthusiasts' site!"
=========================================================
You need cisco training for pass exams and get certificate.


Automated Tool for accessibility

I am very curious as to what you have created here for testing accessilibity testing for Drupal sites. I am looking for some sort of module that will check code on the fly, but haven't found anything. Any help would be appreciated!!!

Thanks,
A.J.