1 number.module number_field_instance_settings_form_validate($element, &$form_state, $form)

Form validation handler for number_field_instance_settings_form().

Make sure the maximum setting is greater than or equal to the minimum setting.

File

core/modules/field/modules/number/number.module, line 115
Defines numeric field types.

Code

function number_field_instance_settings_form_validate($element, &$form_state, $form) {
  $max = $element['max'];
  $min = $element['min'];

  if (!empty($max['#value']) && $max['#value'] < $min['#value']) {
    form_error($max, t('%max must be greater than, or equal to, %min.', array(
      '%max' => $max['#title'],
      '%min' => $min['#title'],
    )));
  }
}