function domain_form_validate in Domain Access 6.2
Same name and namespace in other branches
- 7.3 domain.admin.inc \domain_form_validate()
- 7.2 domain.admin.inc \domain_form_validate()
Implement domain_form validate hook.
1 string reference to 'domain_form_validate'
- domain_form in ./
domain.admin.inc - FormsAPI for editing a domain record
File
- ./
domain.admin.inc, line 502 - Administration functions for the domain module.
Code
function domain_form_validate($form, &$form_state) {
$subdomain = $form_state['values']['subdomain'];
$error_list = array();
$domain_changed = (bool) strcmp($form_state['values']['subdomain'], $form['domain']['subdomain']['#default_value']);
if ($domain_changed && !domain_unique_domain($subdomain)) {
$error_list[] = t('The domain value must be unique.');
}
$error = domain_valid_domain($subdomain);
if (!empty($error)) {
$error_list[] = $error;
}
foreach ($error_list as $error) {
form_set_error('subdomain', $error);
}
}