You are here

function regcode_admin_create_validate in Registration codes 7

Same name and namespace in other branches
  1. 6.2 regcode.admin.php \regcode_admin_create_validate()
  2. 6 regcode.admin.php \regcode_admin_create_validate()
  3. 7.2 regcode.admin.inc \regcode_admin_create_validate()

Validate create form.

File

./regcode.admin.php, line 228
Functions and pages needed for the admin UI of regcode module.

Code

function regcode_admin_create_validate($form, &$form_state) {
  if (!is_numeric($form_state['values']['regcode_create_maxuses']) || $form_state['values']['regcode_create_maxuses'] < 0) {
    form_set_error('regcode_create_maxuses', t('Invalid maxuses, specify a positive integer or enter "0" for unlimited'));
  }
}