简体   繁体   English

_self不适用于href

[英]_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内,如下所示,但是问题是,当用户单击“ Forgot the password ,它将在整个页面上而不是在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 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. _self是目标标签的标准配置。 It opens the link in the same browser window, just what you are describing. 它将在您所描述的同一个浏览器窗口中打开链接。 DIVs are not iFrames. DIV不是iFrame。 (And no one wants iFrames for something like this. Really.) (没有人想要iFrame这样的东西。真的。)

You have to build your div-structure again at your forgotpassword.php. 您必须再次在forgotpassword.php中构建div结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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