You are here

function mostpopular_settings_form_validate in Drupal Most Popular 6

Same name and namespace in other branches
  1. 7 mostpopular.admin.inc \mostpopular_settings_form_validate()

File

./mostpopular.admin.inc, line 113
Defines all the administration forms for the Most Popular module.

Code

function mostpopular_settings_form_validate($form, &$form_state) {

  // Validate the max results box
  $max = (int) $form_state['values']['mostpopular_max'];
  if (empty($max) || !is_integer($max) || $max <= 0) {
    form_set_error('mostpopular_max', t('You must enter a positive number'));
  }
}