[Plugin: Contact Form 7] Use labels for checkboxes and radio buttons (patch included)
-
Update: use
<label>
elements for the text labels of checkboxes and radio buttons, so users can click these to activate the checkbox.This patch is for the latest release of
wp-contact-form-7.php
(version contact-form-7.1.9.4.zip)Please update the distribution as well, thanks!
--- wp-contact-form-7.php 2009-03-23 14:20:45.000000000 +0100 +++ wp-contact-form-7.php.PATHCED 2009-03-22 10:08:02.000000000 +0100 @@ -1346,11 +1346,11 @@ ! $multiple && $_POST[$name] == $value)) $checked = ' checked="checked"'; if (preg_grep('%^label[_-]?first$%', $options)) { // put label first, input last - $item = '<label class="wpcf7-list-item-label" for="' . "$name-$key" . '">' . $value . '</label> '; - $item .= '<input type="' . $input_type . '" id="' . "$name-$key" . '" name="' . $name . ($multiple ? '[]' : '') . '" value="' . attribute_escape($value) . '"' . $checked . $onclick . ' />'; + $item = '<span class="wpcf7-list-item-label">' . $value . '</span> '; + $item .= '<input type="' . $input_type . '" name="' . $name . ($multiple ? '[]' : '') . '" value="' . attribute_escape($value) . '"' . $checked . $onclick . ' />'; } else { - $item = '<input type="' . $input_type . '" id="' . "$name-$key" . '" name="' . $name . ($multiple ? '[]' : '') . '" value="' . attribute_escape($value) . '"' . $checked . $onclick . ' />'; - $item .= ' <label class="wpcf7-list-item-label" for="' . "$name-$key" . '">' . $value . '</label>'; + $item = '<input type="' . $input_type . '" name="' . $name . ($multiple ? '[]' : '') . '" value="' . attribute_escape($value) . '"' . $checked . $onclick . ' />'; + $item .= ' <span class="wpcf7-list-item-label">' . $value . '</span>'; } $item = '<span class="wpcf7-list-item">' . $item . '</span>'; $html .= $item;
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Plugin: Contact Form 7] Use labels for checkboxes and radio buttons (patch included)’ is closed to new replies.