function weight_value

weight_value(&$form)

Sets the value for a weight element, with zero as a default.

Related topics

File

includes/form.inc, line 3166
Functions for form and batch generation and processing.

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!form.inc/function/weight_value/7.x