Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

avatar_selection_config_form_validate

Definition

avatar_selection_config_form_validate($form, &$form_state)
contributions/avatar_selection/avatar_selection.module, line 891

Description

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.

Code

<?php
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;
    }
  }
}
?>