When exposing a views filter, the name attribute of the form submit button is empty. This is causing an error on W3C validation.
Bad value '' for attribute name on element button: Must not be empty.
The name attribute has been left empty on purpose, as mentioned in a comment in views.module
// Form submit, #name is an empty string to prevent showing up in $_GET.
$form['submit'] = array(
'#name' => '',
'#type' => 'submit',
'#value' => t('Apply'),
'#id' => drupal_html_id('edit-submit-' . $view->name),
);Here is an issue reported against Drupal core for this same issue, still in Needs Work status:
https://www.drupal.org/project/drupal/issues/2637680
Until this is fixed in core we need a way to remove this error so our page will validate. Adding this as a feature request in wetkit_bootstrap as this can be fixed at the theme layer with theme_button().
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | remove-empty-name-attribute-on-button-2986639.patch | 926 bytes | smulvih2 |
Comments
Comment #2
smulvih2Here is a patch for the
button.func.phpfile in wetkit_bootstrap to remove empty name attribute from form buttons. Page with views exposed filters now validate.Comment #3
sylus commentedThis looks good to me :) Thanks for taking the time, greatly appreciated.
Comment #4
natew commentedThanks for the patch :)
Committed and attributed
Comment #6
smulvih2