You are here

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

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

Validation for numeric textfields.

2 string references to 'merci_is_numeric_validate'
merci_form_alter in ./merci.module
Implementation of hook_form_alter().
merci_rro_add_new_override in modules/merci_rro/merci_rro.admin.inc

File

./merci.module, line 1716
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'],
    )));
  }
}