You are here

function certificate_field_grouping_add_form_validate in Certificate 6.2

Same name and namespace in other branches
  1. 6 certificate.admin.inc \certificate_field_grouping_add_form_validate()

Validate the fieldgroup machine name.

File

./certificate.admin.inc, line 369
Administrative pages for Certificate module.

Code

function certificate_field_grouping_add_form_validate(&$form, &$form_state) {
  $fieldgroup_name = $form_state['values']['fieldgroup_name'];
  $fieldgroups = variable_get('certificate_field_groups', array());
  if (isset($fieldgroups[$fieldgroup_name])) {
    form_set_error('fieldgroup_name', 'Duplicate, please choose another name.');
  }
}