I had the same issue, and yes I had my jquery included first followed by the jquery validate script. I had no idea what was wrong. Turns out I was using a validate url that had moved. I figured this out by doing the following:
In my situation I had a 403 Forbidden error when trying to obtain (http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js which is used in the example on http://rocketsquared.com/wiki/Plugins/Validation ).
Turns out the that link (http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js) had moved to http://view.jquery.com/trunk/plugins/validate/jquery.validate.js (Firebug told me this when I loaded the file locally as opposed to on my web server).
NOTE: I tried using microsoft's CDN link also but it failed when I tried to load the javascript file in the browser with the correct url, there was some odd issue going on with the CDN site.
youll need to use the latest http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.js in conjunction with one of the Microsoft's CDN for getting your validation file.
Check if you use Proxy.
I've got this problem in Mozilla Firefox, I thought it's some issue related to the Firefox itself. Later I found out that I am using a proxy server. When I unchecked the proxy, everything got fine.
In my case i moved the validate part outside of the document ready function and it works fine for me. I hope it would work for u...
$(document).ready(function () {
// paste validate function outside of the document ready function...
});
$('#form1').validate({
rules: {
English_Name: { required: true, minlength: 3 },
Arabic_Name: { required: true, minlength: 3 },
latitude: { required: true, min: 16, max: 32, number: true },
longitude: { required: true, min: 32, max: 52, number: true },
EmployeeID: { required: true },
PaymentTypeID: { required: true },
BusinessTypeID: { required: true },
SalesTypeID: { required: true },
OutletLength: { required: true },
OutletWidth: { required: true },
CONTACT_PERSON: { required: true },
MOBILE_NO: { required: true, minlength: 9, maxlength: 13, digits: true },
TRADE_LIC_DATE: { dateValidation: true },
CreditLimit: { min: 0, max: 2000000 },
CreditPeriod: { min: 0, max: 365 },
EMAIL_ADDRESS: { email: true },
BusinessClassID: { required: true },
CustomerClassificationID: { required: true },
LicenseTypeID: { required: true }
},
message: {
English_Name: {
required: ''
},
ToDate: {
required: ''
}
},
submitHandler: function (form) { // for demo
$.ajax({
type: 'POST',
url: '/sfa/Verification/SaveDataInDatabase',
data: $('form').serialize(),
beforeSend: function () {
$('.submitBtn').attr("disabled", "disabled");
$('.modal-body').css('opacity', '.5');
},
success: function (msg) {
$("#form1").trigger('reset');
$('.modal').modal('hide');
$('.submitBtn').removeAttr("disabled");
$('.modal-body').css('opacity', '');
}
});
}
});
Probably the browser first downloaded the validade script and then jQuery. If the validade script be downloaded before loading jQuery you'll get an error. You can see this using a tool like firebug.
Try this:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>
function LoadValidade() {
var a = false;
try {
var teste = $('*');
if(teste == null)
throw 1;
} catch (e) {
a = true;
}
if (a){
setTimeout(LoadValidade, 300);
return;
}
var validadeScript = document.createElement("script");
validadeScript.src = "../common/jquery.validate.js";
$('head')[0].appendChild(validadeScript);
}
setTimeout(LoadValidade, 300);
</script>
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.