Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I created custom login form with help of article and it is working fine when we submit with correct credentials. But it is not displaying validation error messages when condition is failed. I am searching from last 4 hours but i did not get any results.I am posting my code below.
<?php global $user;
global $base_url;
?>
<?php if ($user->uid) : ?>
<span class="login_text">Welcome, </span> <?php print ($user->name); ?> <br>
<?php print l("Your Account",'user/'.$user->uid); ?> |
<?php print l("Log-Out","logout", array(), drupal_get_destination()); ?>
<?php else : ?>
<span class="login_text"><b>Login:</b> </span>
<form action="<?php echo $base_url; ?>/user" method="post">
<div><div class="form-item"><?php print $messages; ?>
<label for="edit-name"><span class="login_text">Username:</span><span class="form-required" title="This field is required.">*</span>
<input type="text" maxlength="60" name="edit[name]" id="edit-name" size="10" value="" tabindex="1" class="form-text required" /></label>
<label for="edit-pass"><span class="login_text">Password:</span><span class="form-required" title="This field is required.">*</span>
<input type="password" maxlength="" name="edit[pass]" id="edit-pass" size="10" tabindex="2" class="form-text required" /></label>
<input type="hidden" name="edit[form_id]" id="edit-form_id" value="user_login" />
<input type="submit" name="op" value="Log in" tabindex="3" class="form-submit" /></form>
<?php endif; ?>
Any Ideas?
Thank you in Advance.
Comments
Comment #1
faruq1256 CreditAttribution: faruq1256 commentedAt last i get the Solution. i am posting the code which is working fine for me.In that code i just changed input field's name and id like
.
Comment #2
Pomliane CreditAttribution: Pomliane commentedThis version of Usernode is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.