Hello!
I use Better Exposed Filters 7.x-3.0-beta4 for exposed sort criteria.
I receive the following validation error: " Line 298, Column 31: The for attribute of the label element must refer to a form control."
Here is the html:

<div class="views-exposed-widget views-widget-sort-by">
    <div class="bef-sortby bef-select-as-radios">
<div class="form-item form-type-radios form-item-sort-by">
<label for="edit-sort-by">Sort by </label>
<div class="form-radios" id="edit-sort-by">
<div class="form-item form-type-radio form-item-sort-by">
<input type="radio" class="form-radio" value="sell_price" name="sort_by" id="edit-sort-by-sell-price">
<label for="edit-sort-by-sell-price" class="option">Price </label>
</div>
<div class="form-item form-type-radio form-item-sort-by">
<input type="radio" class="form-radio" value="created" name="sort_by" id="edit-sort-by-created">
<label for="edit-sort-by-created" class="option">Post date </label>
</div>
</div>
</div>
</div>
</div>

I also tried to change the "Display exposed sort options as Radio buttons" to "Display exposed sort options as links". The same validation error.
The patch better_exposed_filters-w3c-validation-1241192-10.patch
did not resolve the issue. It works for exposed filters, not for exposed sort criteria.
Can you help me with the problem?
Kind regards,
Tchka

Comments

tisteegz’s picture

I am also having the same issue. Has anyone found a fix for this?

mikeker’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not able to reproduce this with the latest BEF. Yes, it does generate a <label> tag with a for attribute that points to a <div> instead of a form element. But as far as I can tell, that's valid. At least my page passes the W3C validator. Can you point me at a public-facing example that is not working? Also, are you validating as "XHTML + RDFa"?

mikeker’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)