function guestbook_form_entry_form_validate in Guestbook 7.2
Same name and namespace in other branches
- 6.2 guestbook.module \guestbook_form_entry_form_validate()
Form validation function for guestbook_form_entry_form.
File
- ./
guestbook.module, line 585
Code
function guestbook_form_entry_form_validate($form, &$form_state) {
// Check whether name of anonymous user is an registered user's name.
if (!empty($form_state['values']['anonname'])) {
if ($existing = user_load_by_name($form_state['values']['anonname'])) {
form_set_error('anonname', t('%name is a registered user name. Please enter a different name.', array(
'%name' => $form_state['values']['anonname'],
)));
}
}
}