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().

Comments

smulvih2 created an issue. See original summary.

smulvih2’s picture

Here is a patch for the button.func.php file in wetkit_bootstrap to remove empty name attribute from form buttons. Page with views exposed filters now validate.

sylus’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me :) Thanks for taking the time, greatly appreciated.

natew’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch :)

Committed and attributed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

smulvih2’s picture