我正在尝试通过wordpress上的bootstrap进行身份验证/注册页面 这是我用Bootstrap Modal插入的代码。
问题是,当我输入登录名/密码并点击Enter按钮时,它只会关闭模态。当我再次点击打开模态时,我的输入信息就在那里,我仍然可以点击登录按钮登录。我从WordPress登录页面(我正在使用的引擎)处理代码。
如何让Enter自动记录我?
<div id="login" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Login" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h5 id="Login">
<ul class="nav nav-pills">
<li class="active"><a href="#loginpill" data-toggle="pill">ავტორიზაცია</a></li>
<li><a href="#registrationpill" data-toggle="pill">რეგისტრაცია</a></li>
</ul>
</h5>
</div>
<div class="pill-content">
<div class="pill-pane active" id="loginpill">
<div class="modal-body">
<form name="loginform" id="loginform" action="/wp-login.php" method="post">
<p>
<input type="text" name="log" id="user_login" class="input span5" style="height:50px;font-size:20px" placeholder="სახელი" size="40" /></label>
</p>
<p>
<input type="password" name="pwd" id="user_pass" class="input span5" style="height:50px;font-size:20px" placeholder="პაროლი" size="40" /></label>
</p>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> დამიმახსოვრე</label></p>
</div>
<div class="modal-footer">
<a href="/wp-login.php?action=lostpassword" class="pull-left" title="Password Lost and Found">პაროლის აღდგენა</a>
<button class="btn" data-dismiss="modal" aria-hidden="true">დახურვა</button>
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-primary" value="შესვლა" />
<input type="hidden" name="redirect_to" value="/" />
<input type="hidden" name="testcookie" value="1" />
</div>
</form>
</div>
<div class="pill-pane" id="registrationpill">.v..</div>
</div>
</div>
答案 0 :(得分:1)
尝试将关闭模式的按钮放在<form>
之外:
<div id="login" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Login" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h5 id="Login">
<ul class="nav nav-pills">
<li class="active"><a href="#loginpill" data-toggle="pill">ავტორიზაცია</a></li>
<li><a href="#registrationpill" data-toggle="pill">რეგისტრაცია</a></li>
</ul>
</h5>
</div>
<div class="pill-content">
<div class="pill-pane active" id="loginpill">
<div class="modal-body">
<form name="loginform" id="loginform" action="/wp-login.php" method="post">
<p>
<input type="text" name="log" id="user_login" class="input span5" style="height:50px;font-size:20px" placeholder="სახელი" size="40" /></label>
</p>
<p>
<input type="password" name="pwd" id="user_pass" class="input span5" style="height:50px;font-size:20px" placeholder="პაროლი" size="40" /></label>
</p>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> დამიმახსოვრე</label></p>
</form>
</div>
<div class="modal-footer">
<a href="/wp-login.php?action=lostpassword" class="pull-left" title="Password Lost and Found">პაროლის აღდგენა</a>
<button class="btn" data-dismiss="modal" aria-hidden="true">დახურვა</button>
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-primary" value="შესვლა" />
<input type="hidden" name="redirect_to" value="/" />
<input type="hidden" name="testcookie" value="1" />
</div>
</div>
<div class="pill-pane" id="registrationpill">.v..</div>
</div>
</div>