I have a form on my page that I am having trouble receiving a success response from only in IE. The form works fine in all other browsers. It never works the first time the browser is open, but once you open developer tools in IE, it starts working and you can see the success message…
I have a test site I can PM if people are willing to help. Any help is much appreciated.
I am using the jQuery Form plugin and Validation plugin. Here is my form code:
/* feedback form validation */
$('#feedback_form').validate();
/* submit form via ajax and get confirmation thank you */
$("#feedback_form").ajaxForm({
target: "#hiddenDiv",
url : $(this).attr('action'),
type : $(this).attr('method'),
dataType: 'json',
data : $(this).serialize(),
success: function(data, status) {
console.log( 'SUCCESS: ' + data['success'] + " status: " + status);
var msg = data['success'];
switch (msg){
case true:
$("#form").slideUp(200, function() {
$('#thankyou').show(400);
$("#captcha_error").css("display", "none");
setTimeout( function(){
$('#feedback-container').modal('hide')
}, 4000);
});
break;
default:
$('#msg').html( $("#hiddenDiv #content ul").html() );
break;
}
}
});
consoleis undefined in IE by default. Your call toconsole.logwill cause a javascript error, which is why the javascript won’t work. Ironically, since developer tools defines a globalconsoleobject, as soon as you try to debug your javascript it all works fine, one of Murphy’s programming laws in action!