wpsharks / s2member

s2Member® Framework (membership management for WordPress®).
64 stars 36 forks source link

Radio and Checkbox labels have a 'for' attribute not matching the input's id #1162

Open beanroot opened 5 years ago

beanroot commented 5 years ago

I am using Checkboxes (multi option) or radio Buttons (multioption) field types in the User Profile and Registration form.

Radio and Checkbox labels have a 'for' attribute that does not match the input's id. This means the option labels are not clickable. (It also prevents some restyling of these input types)

Here is the erroneous html from the registration form: <input type="checkbox" value="Antarctica" name="s2member_pro_authnet_checkout[custom_fields][region_origin][]" id="s2member-pro-authnet-checkout-custom-reg-field-region-origin---1" aria-required="true" tabindex="110" class="s2member-pro-authnet-custom-reg-field-region-origin s2member-pro-authnet-checkout-custom-reg-field-region-origin" /> <label for="s2member-pro-authnet-checkout-custom-reg-field-region-origin-1" class="ws-plugin--s2member-custom-reg-field-op-l" style="display:inline !important; margin:0 !important;">Antarctica</label>

In this code, the label has for="s2member-pro-authnet-checkout-custom-reg-field-region-origin-1" but the input has id="s2member-pro-authnet-checkout-custom-reg-field-region-origin---1" --they should match.

(I am using a new Version 170722 + s2Member Pro v170722 )