Label for attribute and textarea id attribute differ
-
using latest version (2.3) of the grunion contact form plugin. thanks for all your work. i found that the id of the textarea label does not match the for attribute of its label. i changed my local code to read:
elseif ( $field['type'] == 'textarea' ) { $r .= "\n<div>\n"; $r .= "\t\t<label for='contact-form-comment-".esc_attr($field_id)."' class='".esc_attr($field['type']) . ( contact_form_is_error($field_id) ? ' form-error' : '' ) . "'>" . htmlspecialchars( $field['label'] ) . ( $field['required'] ? '<span>'. __("(required)") . '</span>' : '' ) . "</label>\n"; $r .= "\t\t<textarea name='".esc_attr($field_id)."' id='contact-form-comment-".esc_attr($field_id)."' rows='20'>".htmlspecialchars($field_value)."</textarea>\n"; $r .= "\t</div>\n"; }
this fixed the mismatched label.
hope this helps and thanks!
https://www.ads-software.com/extend/plugins/grunion-contact-form/
- The topic ‘Label for attribute and textarea id attribute differ’ is closed to new replies.