You are here

function autofloat_admin_settings_validate in AutoFloat 6.2

Same name and namespace in other branches
  1. 7.2 autofloat.admin.inc \autofloat_admin_settings_validate()

Validate autofloat settings submission.

File

./autofloat.admin.inc, line 51
The admin settings for the AutoFloat module.

Code

function autofloat_admin_settings_validate($form, &$form_state) {

  // Accept maximum two class value for the selector field.
  $limit = $form_state['values']['autofloat_span'];
  if (substr_count($limit, ',') > 1) {
    form_set_error('autofloat_span', t('Not more than two values.'));
  }

  // Accept maximum two class value for the rejector field.
  $limit = $form_state['values']['autofloat_div'];
  if (substr_count($limit, ',') > 1) {
    form_set_error('autofloat_div', t('Not more than two values.'));
  }
}