You are here

function webform_checkbox_prerender in Webform 6.3

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 'webform_checkbox_prerender'
webform_expand_checkboxes in components/select.inc
Drupal 6 hack that properly *renders* checkboxes in multistep forms. This is different than the value hack needed in Drupal 5, which is no longer needed.

File

components/select.inc, line 472
Webform module multiple select component.

Code

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