<script type="text/javascript">
<!--
$(document).ready(function() {
$("#form1").validate({
rules: {
budget: {
required: true,
minlength:3
} ,
duration: {
required: true,
digits:true
},
town: {
required: true,
minlength:2
},
content: {
required: true,
minlength:300
}
},
messages: {
}
});
});
-->
</script>
Two jquery files are included.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="../common/jquery.validate.js"></script>
are included. There is nothing wrong with the inclusion.
I got an error message
$("#form1").validate is not a function What's wrong?
I just encountered this extremely frustrating error and lost the better part of an hour to it, for lack of a workable answer online. I confirmed in Firebug that I was hitting the CDN for both jQuery and validation.
In the end, changing this:
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js"></script>
to this:
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
was all I needed.