Я попытался использовать 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 -->
Я изменил название кнопки к другому, чем по умолчанию, как говорит создатель, но до сих пор не работает. Любые идеи почему? Однако проверка достоверна.
Вы связали библиотечный jquery.min.js 'и «самозагрузки .min.js? – MarioZ
Да, я сделал. Нет ошибок при проверке страницы. – Bobys