You are here

function share42_validate_number in Share42 - social sharing buttons 6

1 string reference to 'share42_validate_number'
share42_block in ./share42.module
Implements hook_block().

File

./share42.module, line 88
Main file for the Share42 module.

Code

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