You are here

function responsive_navigation_settings_validate in Responsive Navigation 7

Custom validation for the settings form.

1 string reference to 'responsive_navigation_settings_validate'
responsive_navigation_admin_settings in ./responsive_navigation_admin.inc
Settings form as implemented by hook_menu.

File

./responsive_navigation_admin.inc, line 32

Code

function responsive_navigation_settings_validate($form, &$form_state) {
  $number = $form_state['values']['responsive_navigation_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('responsive_navigation_number', t('You must enter a number from 0 to 99.'));
  }
}