You are here

function merci_is_numeric_validate in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_is_numeric_validate()
  2. 6 merci.module \merci_is_numeric_validate()

Validation for numeric textfields.

2 string references to 'merci_is_numeric_validate'
merci_add_settings_form in ./merci.module
merci_form_alter in ./merci.module
Implementation of hook_form_alter().

File

includes/api.inc, line 332
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_is_numeric_validate($form) {
  if ($form['#value'] && !is_numeric($form['#value'])) {
    form_set_error($form['#name'], t('%title must be a number.', array(
      '%title' => $form['#title'],
    )));
  }
}