You are here

function avatar_selection_config_form_validate in Avatar Selection 7

Same name and namespace in other branches
  1. 5.2 avatar_selection.module \avatar_selection_config_form_validate()
  2. 5 avatar_selection.module \avatar_selection_config_form_validate()
  3. 6 avatar_selection.admin.inc \avatar_selection_config_form_validate()

Validate the submission.

Ensure the number of avatars page setting is numeric.

Parameters

$form: General variable used in drupal, defining the structure & the fields of a form.

&$form_state: General reference, used to control the processing of the form.

File

./avatar_selection.admin.inc, line 580
Administrative page callbacks for the avatar_selection module.

Code

function avatar_selection_config_form_validate($form, &$form_state) {
  $error = FALSE;
  if ($form_state['values']['op'] == t('Update')) {
    if (!is_numeric($form_state['values']['avatar_per_page'])) {
      form_set_error('avatar_per_page', t('Must be a number.'));
      $error = TRUE;
    }
  }
}