私はBootstrapValidatorを使用しようとしましたが、何らかの理由でJSスクリプトを削除しない限りフォームを送信しません。BootstrapValidatorはフォームを提出しません
JSスクリプトは次のとおりです。
$(document).ready(function() {
$('#loginForm').bootstrapValidator({
framework: 'bootstrap',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
email: {
validators: {
notEmpty: {
message: 'The email address is required'
},
emailAddress: {
message: 'The input is not a valid email address'
}
}
},
pass: {
validators: {
notEmpty: {
message: 'The password is required'
},
different: {
field: 'email',
message: 'The password cannot be the same as username'
}
}
},
}
});
});
そして、私形式:
<div class="col-sm-4 col-sm-offset-5 col-md-4 col-md-offset-5 main">
<h1 class="page-header">Please sign in</h1>
<form id="loginForm" class="form-signin" action="ApplicantLogin.php" method="POST">
<label for="inputEmail" class="sr-only">e-Mail</label>
<input type="text" id="inputEmail" class="form-control" placeholder="e-Mail" name="email" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" name="pass" required>
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" name="loginbtn" value="login">Sign in</button>
</form>
</div> <!-- /container -->
私は、作成者が示唆するように、デフォルトとは異なるにボタン名を変更しましたが、まだ動作していません。なぜどんなアイデア?検証作業はうまくいきます。
をリンクされていること
ええ、私はした。私はページを調べるときにエラーはありません。 – Bobys