$(document).ready(function () {
$("#MyForm").submit(function () {
alert("Hello");
return true;
});
});
Hi, I have a very simple code above, when I submit the form in IE8 nothing happens, but it works fine in FireFox 8.
I am using jQuery 1.5.1. So is it a problem from old version of jQuery?
I've seen this before in IE8 and IE7. Workaround:
$("#MyForm").submit(function () {
alert("Hello");
return true;
});
// change input type to whatever submits the form
$("#MyForm input[type='submit']").click(function(e) {
e.preventDefault();
$(this).closest("form").submit();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With