$ ('# my_form'). ajaxForm opens PHP page instead of content reload (Safari, Chrome)
My ajaxForm request is not working as expected in Safari and Chrome. Instead of receiving a response from a php file, it opens it as a new page. (works great in FF, IE, Opera):
$('#my_form').ajaxForm({
success: finished
});
function finished(responseText, statusText) {
...
}
Thank you for your help!
+2
xyyp
source
to share
1 answer
in the same plugin can find this example:
$(document).ready(function() {
$('#myForm').bind('submit', function() {
$(this).ajaxSubmit({
target: '#output'
});
return false; // <-- important!
});
});
You can do it in the same form in the onSubmit event:
<form ... onSubmit="return false;">
+3
source to share