I am trying to submit a form through ajax using GET method. It works fine in FF, CHROME and other browsers except IE7 and IE8. I am using jQuery 1.6 and I am validating the form using jQuery Validation Plugin 1.10.0
Form is getting validated but when I try to submit it refreshes the page instead of AJAX. In console its not displaying any error
Heres my JS Function
function formSubmit(formID, displayMssgID) {
jQuery(function($) {
var qstring = $('#' + formID).serialize();
jQuery.validator.addMethod("notEqual", function(value, element, param) {
return this.optional(element) || value != param;
}, "Please enter your name.");
var val = $('#' + formID).validate( {
rules : {
Mobile : {
number : true,
minlength : 8
},
Name: {
required: true,
notEqual: "Name"
}
}
}).form();
if (val) {
$('.overlayss').fadeIn();
$('#prospectLoading').fadeIn();
$('#prospectLoading').append('<div class="process_img"> Registering your Request ...<br />Please Wait ...</div> ');
$.ajax( {
url : "index.php",
data : qstring,
cache:false,
success : function(data) {
// resetFormFields(formID);
if(formID == 'siteVisit'){
$('#cart ul').html('');
}
//$('#' + displayMssgID).html('');
$('#prospectLoading').html('');
$('#prospectLoading').append(data);
//$('#' + displayMssgID).append(data);
window.setTimeout(function() {
$('#prospectLoading').html('');
$('.overlayss').fadeOut();
$('#prospectLoading').fadeOut();
}, 4000);
}
});
}
});
}
You can check the live example on this link http://www.silverline-group.com/projects/Bangalore-Properties.html
Fill up the form on the right sidebar in IE7 or IE8.
Am I doing anything wrong? Or is the validation plugin causing this problem.
i had same problem in IE7 when i used Jquery validation plugin 1.10.0 for my form control validation.
name attribute is not required for it to work anymore.
JQUERY PLUGIN VALIDATION
Another important thing,ID and Name must be specified for the elements you are validating as well as for the form and submit button. While FF and Chrome works without these, IE doesn’t.
The tab-out validation does work without the name, but not the form submit validation.