I've tried to theme a search block and found out that all drupal submit buttons share the same html id (edit-submit).
This is not html compliant, since an id has to be unique.
So every page for example with a search block and another drupal generated submit button in the content is not html compliant. See also pages with multiple submit buttons like /admin/content/node or /search/node/ with advanced search enabled.

The id in the output is generated by function theme_button($element) in includes/form.inc. The easiest way to correct the problem would be to change the id of the button to a class. I'm not experienced enough to know if this may have unwanted side effects for themes or javascript functions, since form.inc usually adds an id to a html element and it is a very basic function.
If form.inc is not changed every $form['submit'] in core and all the modules is wrong, since it should be something like $form['my_unique_module_submit'].

Since a search block is often used, here is a sample patch for the search.module (which solved the problem for me temporarily) :

function search_form
1001c1001
< $form['basic']['inline']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
> $form['basic']['inline']['search_inline_submit'] = array('#type' => 'submit', '#value' => t('Search'));

function search_box
1041c1041
< $form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
> $form[$form_id.'_submit'] = array('#type' => 'submit', '#value' => t('Search'));

and node.module for the advanced search

function node_form_alter
2546c2546
< $form['advanced']['submit'] = array(
> $form['advanced']['advanced_search_submit'] = array(

Comments

quadbyte’s picture

Just ran into this same problem, I'm using simplenews registration block + drupal search block on every page.
So none of my pages validate :(
I guess we need a more generic fix as it's hard to check all modules to check if they share form ids.

dman’s picture

Status: Active » Closed (duplicate)

Duplicate
http://drupal.org/node/87708
Duplicate
http://drupal.org/node/71615
Duplicate
http://drupal.org/node/114500 (actually with a work-around)
Duplicate
http://drupal.org/node/111719 (most active, go there)

... now what was that you were saying about duplicates?