[Resolved] Toolset Views – Text search 'Missing form label' error using WAVE
This thread is resolved. Here is a description of the problem and solution.
Problem:
The customer encountered an accessibility error "Missing form label" when running an accessibility check using WAVE on a search filter created with Toolset Views. The issue was due to the text search input field missing an id attribute, which caused the WAVE tool to flag the error. The customer attempted to add a label with the for attribute but still encountered the issue.
Solution:
We initially suggested including both the label and the wpv-filter-search-box shortcode within the
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I am using the Toolset Views to create a search filter. When I used WAVE to do a accessibility check, it output this error:
'Missing form label'
I have a text search in my filter and I have added a label for the text search, so in the 'Search and Pagination', I have this :
<div class="form-group form-search">
<label for="wpv_post_search" class="screen-reader-text">[wpml-string context="wpv-views" name='Event filter - all events search label']Search[/wpml-string]</label>
[wpv-filter-search-box placeholder="Search by pressing Enter"]
</div>
The output HTML is:
<div class="form-group form-search">
<label for="wpv_post_search" class="screen-reader-text">Search</label>
<input type="text" name="wpv_post_search" class="js-wpv-filter-trigger-delayed" placeholder="Search by pressing Enter">
</div>
The text search form doesn't have an id attribute, so that's why it's outputting the ''Missing form label' error. I want to add an id name for this form, like below:
<input type="text" name="wpv_post_search" class="js-wpv-filter-trigger-delayed" placeholder="Search by pressing Enter" id="wpv_post_search">
How and can we add the id attribute to the text search form?