You are here

function weight_value in Drupal 5

Same name and namespace in other branches
  1. 4 includes/form.inc \weight_value()
  2. 6 includes/form.inc \weight_value()
  3. 7 includes/form.inc \weight_value()

If no default value is set for weight select boxes, use 0.

Related topics

File

includes/form.inc, line 1250

Code

function weight_value(&$form) {
  if (isset($form['#default_value'])) {
    $form['#value'] = $form['#default_value'];
  }
  else {
    $form['#value'] = 0;
  }
}