You are here

function suggestion_admin_edit_form_validate in Autocomplete Search Suggestions 7

Custom submit function for the suggestion setting form.

1 string reference to 'suggestion_admin_edit_form_validate'
suggestion_admin_edit_form in ./suggestion.admin.inc
Menu callback to index suggestions.

File

./suggestion.admin.inc, line 89
Administration form for suggestion module.

Code

function suggestion_admin_edit_form_validate($form, &$state) {
  if (!is_numeric(trim($state['values']['qty']))) {
    form_set_error('qty', t('The quantity must have a numeric value'));
  }
  if (!count((array) $state['values']['src'])) {
    form_set_error('src', t('The source must have a value.'));
  }
  elseif (isset($state['values']['src'][0]) && count((array) $state['values']['src']) > 1) {
    form_set_error('src', t('The disabled option cannot be combined with other options.'));
  }
}