You are here

function nice_menus_settings_validate in Nice Menus 6

Same name and namespace in other branches
  1. 6.2 nice_menus.admin.inc \nice_menus_settings_validate()
  2. 7.3 nice_menus.admin.inc \nice_menus_settings_validate()
  3. 7.2 nice_menus.admin.inc \nice_menus_settings_validate()

Custom validation for the settings form.

1 string reference to 'nice_menus_settings_validate'
nice_menus_admin_settings in ./nice_menus.admin.inc
Settings form as implemented by hook_menu

File

./nice_menus.admin.inc, line 34
Functionality for Nice Menus administration.

Code

function nice_menus_settings_validate($form, &$form_state) {
  $number = $form_state['values']['nice_menus_number'];

  // Check to make sure it is a number and that is a maximum of 2 digits.
  if (!is_numeric($number) || strlen($number) > 2) {
    form_set_error('nice_menus_number', t('You must enter a number from 0 to 99.'));
  }
}