You are here

function _flexslider_validate_number in Flex Slider 7

Same name and namespace in other branches
  1. 7.2 flexslider.admin.inc \_flexslider_validate_number()

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

File

./flexslider.admin.inc, line 347
Administrative page callbacks for the flexslider module.

Code

function _flexslider_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'],
    )));
  }
}