You are here

function _element_validate_number in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 includes/content.admin.inc \_element_validate_number()

Helper form element validator : number.

1 string reference to '_element_validate_number'
number_field_settings in modules/number/number.module
Implementation of hook_field_settings().

File

includes/content.admin.inc, line 1910
Administrative interface for content type creation.

Code

function _element_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['#title'],
    )));
  }
}