I have jQuery validate problem. I know it has been asked many times but i still don't see what am I doing wrong
i have this HTML (EDIT: added whole HTML file):
<!DOCTYPE html>
<html>
<head>
<title>Zaposli me :D</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Bootstrap -->
<link href="../assets/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="../assets/css/styles.css" rel="stylesheet" media="screen">
<link href="../assets/css/datepicker.css" rel="stylesheet" media="screen">
<link href="../assets/css/login.css" rel="stylesheet" media="screen">
<!-- <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>-->
<script src="../assets/js/jquery-1.9.0.js"></script>
<script src="../assets/js/bootstrap.min.js"></script>
<script src="../assets/js/jquery.validate.js"></script>
<script src="../assets/js/bootstrap-datepicker.js"></script>
<script src="../assets/js/holder.min.js"></script>
<script src="../assets/js/ajax.js"></script>
<script src="../assets/js/validation.js"></script>
<style type="text/css">
label.valid {
width: 24px;
height: 24px;
/*background: url('assets/img/valid.png') center center no-repeat;*/
display: inline-block;
text-indent: -9999px;
}
label.error {
font-weight: bold;
color: #ff4932;
padding: 2px 8px;
margin-top: 2px;
}
</style>
</head>
<body>
<div class="row container-color">
<div class="col-lg-12">
<div class="panel">
<div class="panel-heading"><i class="icon icon-chevron-up chevron"></i>
<i class="icon icon-wrench pull-right"></i> Dobrodošli
</div>
<div class="panel-content form-horizontal">
<div class="row">
<!-- ========================================== LEFT PART ========================================== -->
<div class="col-lg-6">
<form method="POST" id="registrationForm" action="../controllers/forms.php?register=true">
<fieldset>
<legend>Registruj se</legend>
<div class="form-group">
<label for="email">Email adresa</label>
<input name="email" type="text" class="form-control input-small" id="email" placeholder="Unesite email">
</div>
<div class="form-group">
<label for="name">Ime</label>
<input name="name" type="text" class="form-control input-small" id="name" placeholder="Vaše ime">
</div>
<div class="form-group">
<label for="birth">Datum rođenja</label>
<input name="birth" type="text" class="form-control input-small datepicker" id="birth" placeholder="Unesite vas datum rodjenja">
</div>
<div class="form-group">
<label for="unique_number">Jednistveni broj</label>
<input name="unique_number" type="text" class="form-control input-small" id="unique_number" placeholder="Password">
</div>
<div class="form-group">
<label for="password">Šifra</label>
<input name="password" type="password" class="form-control input-small" id="password" placeholder="Password">
</div>
<div class="form-group">
<label for="repeated_password">Ponovite šifru</label>
<input name="repeated_password" type="password" class="form-control input-small" id="repeated_password" placeholder="Password">
</div>
<div class="control-group">
<label></label>
<div class="controls">
<button type="submit" class="btn btn-default">Registruj se</button>
</div>
</div>
</fieldset>
</form>
</div>
<!-- ========================================== CENTRAL PART ========================================== -->
<div class="col-lg-6">
<form method="POST" id="loginForm" action="../controllers/forms.php?login=true">
<fieldset>
<legend>Uloguj se</legend>
<div class="form-group">
<label for="loginEmail">Email adresa</label>
<input name="loginEmail" type="text" class="form-control input-small" id="loginEmail" placeholder="Unesite email">
</div>
<div class="form-group">
<label for="pass">Password</label>
<input name="pass" type="password" class="form-control input-small" id="pass" placeholder="Password">
</div>
<div class="control-group">
<label></label>
<div class="controls">
<button type="submit" class="btn btn-default">Uloguj se</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div><!--/panel content-->
</div>
</div>
</div>
<script>
$('.datepicker').datepicker();
</script>
<!-- JavaScript plugins (requires jQuery) -->
<script src="http://code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../assets/js/bootstrap.min.js"></script>
</body>
</html>
And this js file (validation.js):
jQuery(function(){
$('#loginForm').validate({
rules: {
loginEmail: {
required: true
}
}
});
});
And here are my included files:
<script src="../assets/js/jquery-1.9.0.js"></script>
<script src="../assets/js/jquery.validate.js"></script>
<script src="../assets/js/validation.js"></script>
I do not get any errors about not loading files. But i do get error about Object [object Object] has no method 'validate' . Anybody knows why?
sources taband see ifvalidate.jsis actually loaded.validate()code is called. Are you using jQuery's.noConflict()method anyplace we can't see? Did you try placing your.validate()code in the page instead of an external file? What basic troubleshooting have you performed? Any?