You are here

function _galleria_validate_number in Galleria 7

Validate a form element that should have a number as value.

1 string reference to '_galleria_validate_number'
galleria_option_elements in includes/galleria.admin.inc
This function returns an array defining the form elements used to edit the different options.

File

includes/galleria.admin.inc, line 732
Administrative page callbacks for the galleria module.

Code

function _galleria_validate_number($element, &$form_state) {
  $value = $element['#value'];
  if ($value !== '' && !is_numeric($value)) {
    form_error($element, t('%name must be a number.', array(
      '%name' => $element['#option_name'],
    )));
  }
}