I have an error showing up in IE 10 and in Chrome:
The chrome version:
Uncaught TypeError: Object function ( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
} has no method 'format'
Unfortunately, I'm not sure what to do to fix the problem, using this script below? (and jquery 1.8.3 - I can't use a newer version right now, it kills other functions on the page for some reason.
$(function() {
// Validate the contact form
$('#contactform').validate({
// Specify what the errors should look like
// when they are dynamically added to the form
errorElement: "label",
wrapper: "div",
errorPlacement: function(error, element) {
error.insertBefore( element.parent().parent() );
error.wrap("<div style='height:0px;overflow:visible;width:200px;margin-right:-200px;z-index:99999300;'></div>");
$("<div style='height:0px;overflow:visible;width:200px;margin-right:-200px;margin-left:0px;z-index:99999300;'></div>").insertBefore(error);
},
// Add requirements to each of the fields
rules: {
name: {
required: true,
minlength: 2
},
last_name: {
required: true,
minlength: 2
},
postal_code: {
required: true,
minlength: 6
},
email: {
required: true,
email: true
},
telephone: {
required: true,
minlength: 10
}
},
// Specify what error messages to display
// when the user does something horrid
messages: {
name: {
required: "Please enter your name.",
minlength: jQuery.format("At least {0} characters required.")
},
last_name: {
required: "Please enter your last name.",
minlength: jQuery.format("At least {0} characters required.")
},
postal_code: {
required: "Please enter a postal code.",
minlength: jQuery.format("At least {0} characters required.")
},
email: {
required: "Please enter your email.",
email: "Please enter a valid email."
},
telephone: {
required: "Please enter a phone number.",
minlength: jQuery.format("At least {0} characters required.")
}
},
// Use Ajax to send everything to processForm.php
submitHandler: function(form) {
$("#send").attr("value", "Sending...");
$(form).ajaxSubmit({
success: function(responseText, statusText, xhr, $form) {
$(form).slideUp("fast");
$("#response").html(responseText).hide().slideDown("fast");
}
});
return false;
}
});
});