Support » Plugin: WP Export Categories & Taxonomies » Checkbox labels have wrong "for" attribute

  • Excellent plugin, thanks!

    Little bug: checkboxes for custom taxonomies all have the same ID (taxs), and their labels have the same “for” attribute, so clicking on any label checks/unchecks the first taxonomy. You need to specify a different ID for each input, and match the “for” attribute on its associated label.

    Actually, I don’t bother with “for” attributes any more, since all modern browsers work just fine if you wrap the label element around the checkbox. You can then remove the IDs from the checkboxes, unless you intend to use access them from JavaScript. e.g.

    <label><input class="checkbox" type="checkbox" name="ect_settings[taxs][features]" value="1" /> features</label><br>
    <label><input class="checkbox" type="checkbox" name="ect_settings[taxs][other]" value="1" /> other</label><br>
    <label><input class="checkbox" type="checkbox" name="ect_settings[taxs][manufacturer]" value="1" /> manufacturer</label>

    cheers,
    Ross

    https://wordpress.org/plugins/wp-export-categories-taxonomies/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Checkbox labels have wrong "for" attribute’ is closed to new replies.