День добрый. В чём суть: делаю форму, подключил плагин jqueryvalidation для валидации
Получилась такая форма где всё работает:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.0/dist/jquery.validate.min.js"></script>
<html>
<head>
<title>Форма</title>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$("#myForm").validate({
rules: {
login: {
required: true,
rangelength: [5, 20]
},
}
});
});
</script>
<h1>HTUTU</h1>
<form name="myForm" id="myForm" action="" method="post">
<label class="lab" for="login">Имя </label><input type="text" name="login" value=""><br>
<input type="submit" name="submit" value="Отправить">
</form>
</body>
</html>
Однако если делаю на bootstrap'e вот так:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.0/dist/jquery.validate.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<html>
<head>
<title>Первый шаблон</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<![endif]-->
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$("#myForm").validate({
rules: {
login: {
required: true,
rangelength: [5, 20]
},
}
});
});
</script>
<form name="myForm" id="myForm" action="" method="post">
<div class="container">
<div class="row otstup">
<div class="col-md-9">
<h2>Обычная форма</h2>
<form role="form">
<div class="form-group">
<label for="login">login</label>
<input type="text" class="form-control" id="login" name="login" value="" placeholder="Введите login">
</div>
<button type="submit" class="btn btn-default">Войти</button>
</form>
</div>
</div>
</body>
</html>
Не работает. Где в коде я мог допустить ошибку???