由於某種原因,我的JQuery不能在我的引導模式下工作。表單的JQuery函數在原始頁面上工作正常,但不在模式上。有人可以告訴我或向我解釋爲什麼會發生這種情況。謝謝!JQuery函數不能在Bootstrap模式下工作
繼承人的代碼:
<div class="modal fade in" id="changepw" tabindex="-1" role="dialog" aria-labelledby="changepwlabel" aria-hidden="false" style="display: block;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="changepwlabel">Change Password</h4>
</div>
<div class="modal-body" id="changepwdiv">
<script src="js/jquery-1.10.2.min.js"></script>
<form action="changepassword.php" method="post">
<div class="input-group">
<span class="input-group-addon">Current Password</span>
<input class="form-control" type="password" name="Password" id="Password">
</div>
<br>
<div class="input-group">
<span class="input-group-addon">New Password</span>
<input class="form-control" type="password" name="password_new" id="password_new">
</div>
<br>
<div class="input-group">
<span class="input-group-addon">New Password Again</span>
<input class="form-control" type="password" name="password_new_again" id="password_new_again">
</div>
<br>
<input type="submit" value="Change" id="change" class="btn btn-success" disabled="">
<input type="hidden" name="token" value="e642d82eed2e2a90529d9debbef45eec">
</form>
<script>
function checkPasswordMatch() {
var password = $("#password_new").val();
var confirmPassword = $("#password_new_again").val();
if (password == confirmPassword)
document.getElementById("change").disabled = false;
else
document.getElementById("change").disabled = true;
}
$(document).ready(function() {
$("#password_new_again").keyup(checkPasswordMatch);
});
</script> </div>
</div>
</div>
</div>
看到任何控制檯錯誤??? – 2014-09-20 05:43:01
沒有,沒有控制檯錯誤 – user3993537 2014-09-20 05:43:52
你面臨的實際問題是什麼......你的表單沒有提交或其他東西? – 2014-09-20 05:45:21