簡體   English   中英

Bootstrap對話框提示(窗體)不起作用

[英]Bootstrap dialog prompt (form) not work

你們可以幫我嗎? 我正在使用boostrap ..,並且在對話框提示中輸入登錄表單,但無法正常工作..

這是鏈接

 <a href="#login" data-toggle="modal">LOGIN</a> 

這是對話框提示的編碼

 <div class="modal fade" id="login" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <form method="post" class="form-horizontal" role="form"> <div class="modal-header"> <h4>Login</h4> <div> <div class="modal-body"> <div class="form-group"> <label for="username" class="col-sm-2 control-label">Name</label> <div class="col-sm-10"> <input type="text" class="form-control" name="username" id="username" placeholder="User Name"> </div> </div> <div class="form-group"> <label for="password" class="col-sm-2 control-label">Password</label> <div class="col-sm-10"> <input type="password" class="form-control" name="password" id="password" placeholder="&#xf111; &#xf111; &#xf111; &#xf111; &#xf111; &#xf111;" style="font-family:Arial, FontAwesome"> </div> </div> </div> <div class="modal-footer"> <a class="btn btn-default" data-dismiss="modal"> CLOSE </a> <button type="submit" class="btn btn-primary" name="login"> LOGIN </button> </div> </div> </div> </form> </div> </div> </div> 

當我單擊LOGIN鏈接時,它將刷新頁面,鏈接將從localhost / signup.php更改為localhost / signup.php#login

請幫我。

這應該可以。.添加date-target=""

<button class="btn btn-primary" data-toggle="modal" data-target="#login">LOGIN</button>

確保已導入bootstrap.css,bootstrap.js以及jQuery,這也是必需的!

您可以嘗試[a href="#" data-toggle="modal" data-target="#login"] LOGIN [/a]而不是[a href="#login" data-toggle="modal"] LOGIN[/a] ,然后再次檢查。

[注意:將方括號更改為角括號。]

如果不起作用,則可能您沒有在頁面中添加bootstrap.js。

因此,首先在頁面中添加bootstrap.css,然后添加jquery.js,再添加bootstrap.js,然后添加任何其他自定義.js頁面。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM