Hello Friends this is my code to form submit and then send post link but form submit success then after not send post link.
document.getElementById(\"pitch_image
When you call .submit()
, it posts the form with the specified action of the .
You might want to stop the propagation, by using either event.stopPropagation();
, event.preventDefault();
or return false;
at the end of your function.
$("#pitch_image_path_form").submit(function(event){
event.stopPropagation();
event.preventDefault();
//Your .post()
return false;
});
Plus, as epascarello pointed out, .submit()
is a jQuery function.
If you want to use it, use it on the jQuery object by removing [0]
before submit()
, as you're not supposed to have multiple elements with the same ID.