简体   繁体   中英

_self is not working with a href

I am making a login form with a link if the user forgot password, this form is inside div as below, but the problem is that when the user click Forgot the password , it opens this page in the whole page not on its div

<div>
<form class="form" method="POST" id="login-nav">
  <div class="form-group">
     <label for="emailaddress">Email address</label>
     <input type="email" class="form-control" id="emailaddress" name="emailaddress"placeholder="Email address" required>
  </div>
  <div class="form-group">
     <label for="pwd">Password</label>
     <input type="password" class="form-control" id="pwd" name="pwd" placeholder="Password" required>
        <div class="help-block text-right"><a href="forgotpassword.php">Forgot the password ?</a></div>
  </div>
  <div class="form-group">
     <button type="submit" id="login_button" name="login_button" class="btn btn-primary btn-block">Sign in</button>
  </div>
</form>

forgotpassword.php

<form action="" method="post">
<div class="form-group">
     <label for="emailaddress">Enter your email address</label>
     <input type="email" class="form-control" id="recovery_email" name="recovery_email" placeholder="Enter your email" required>
</div>
<div class="form-group">
     <button type="submit" id="resetpassword" name="resetpassword" class="btn btn-primary btn-block">Reset Password</button>
</div>

_self is standard for the target-tag. It opens the link in the same browser window, just what you are describing. DIVs are not iFrames. (And no one wants iFrames for something like this. Really.)

You have to build your div-structure again at your forgotpassword.php.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM