Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Commit

Permalink
Modified checkboxes
Browse files Browse the repository at this point in the history
Added `label`s for checkboxes; added `0` or `1` values to checkboxes, instead of on/off.
  • Loading branch information
zackkatz committed Aug 21, 2012
1 parent babc508 commit efe1fab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions init.php
Expand Up @@ -272,8 +272,9 @@ function show() {
echo '<p class="cmb_metabox_description">', $field['desc'], '</p>'; echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
break; break;
case 'checkbox': case 'checkbox':
echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />'; echo '<input type="hidden" value="0" name="', $field['id'], '" />';
echo '<span class="cmb_metabox_description">', $field['desc'], '</span>'; echo '<input type="checkbox" value="1" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
echo '<label for="',$field['id'],'"><span class="cmb_metabox_description">', $field['desc'], '</span></label>';
break; break;
case 'multicheck': case 'multicheck':
echo '<ul>'; echo '<ul>';
Expand Down

0 comments on commit efe1fab

Please sign in to comment.