Accessibility bug in search form template (empty label + missing input id)
-
Hello WP Responsive Menu team,
I found an accessibility/validation issue in the plugin search form markup.
Plugin: WP Responsive Menu
File: wp-content/plugins/wp-responsive-menu/inc/templates/search-form.php
Issue:
The generated search form uses a label with a for attribute, but the associated input has no matching id, and the label text is empty.
Current output (problematic):
label: for="search-form-..."
input: no id
label content: empty
This triggers validator warning:
Incorrect use of <label for=FORM_ELEMENT>
How to reproduce:
Enable the search box in WP Responsive Menu settings.
Open page source on the frontend.
Locate the form with class wpr-search-form.
You will see an empty label and input without matching id.
Why this matters:
Accessibility: screen readers rely on proper label/input association.
HTML validity: fails validation due to incorrect label usage.
UX quality: semantic form structure is broken.
Suggested fix:
Add a meaningful label text (for example, search placeholder text or a translatable “Search” string).
Add id to the input.
Ensure label for and input id use the same generated unique value.
Example expected structure:
<label for="search-form-UNIQUE_ID" class="screen-reader-text">Search</label>
<input id="search-form-UNIQUE_ID" type="search" ...>
Thank you for checking this.
Best regards
Uros
You must be logged in to reply to this topic.