I have create a template for user-register page
I have created a module under hook_form_alter as
if($form_id == 'user_register_form') {
$form['account']['pass']['#type'] = 'password';
$form['account']['pass']['#title'] = 'Password';
$form['account']['mail']['#title'] = 'Email';
$form['actions']['submit']['#value'] = 'Request Access';
$form['#theme'] = 'user_register';
}
Edited:
function custom_user_register_form_validate($form, &$form_state) {
if($form_state['input']['field_first_name']['und'][0]['value'] == ''){
form_set_error('field_first_name', t('Email can not be empty'));
}
drupal_set_message($message, 'error');
if($form_state['input']['field_last_name']['und'][0]['value'] == ''){
form_set_error('field_last_name', 'Title cannot be "test"');
drupal_set_message($message, 'error');
}
return $form;
}
And i have created a user-regiter.tpl.php file
under this i have code like this
<?php print drupal_render($form['field_first_name']); ?>
<?php print drupal_render_children($form); ?>
Which is working fine
Now when i submit form. it doesnt display error message . But it is showing red border in input box.
Why it is not showing error message . Please help
Thanks