You are here

function checkboxes_value in Drupal 4

Same name and namespace in other branches
  1. 5 includes/form.inc \checkboxes_value()

Helper function to load value from default value for checkboxes

Related topics

File

includes/form.inc, line 883

Code

function checkboxes_value(&$form) {
  $value = array();
  foreach ((array) $form['#default_value'] as $key) {
    $value[$key] = 1;
  }
  $form['#value'] = $value;
}