You are here

function select_or_other_checkbox_prerender in Select (or other) 6.2

Helper function to ensure that the default value of "0" checkboxes renders.

The default handling of checkboxes only checks checkboxes based on the #value property. If a checkbox has a value of "0" (as a string), the checkbox doesn't print out the way it should.

See also

theme_checkbox()

1 string reference to 'select_or_other_checkbox_prerender'
select_or_other_expand_checkboxes in ./select_or_other.module
Element process callback for Select (or other) checkboxes.

File

./select_or_other.module, line 261
The Select (or other) module.

Code

function select_or_other_checkbox_prerender($element) {
  if ($element['#value'] === '0') {
    $element['#value'] = TRUE;
  }
  return $element;
}