jQuery提交表单后发送帖子请求? [英] JQuery send post request after submit form?
本文介绍了jQuery提交表单后发送帖子请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友你好,这是我的代码,用于表单提交,然后发送帖子链接,但是表单提交成功,然后不发送帖子链接.
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_path_form").submit(function(e){
$.post("submit_investorform.php",{'flage':'getallimagesfromselectedid','form':'pitch_image_path_form'},function(result){
$("#pitch_image_path_showalldatafromid").html(result);
});
e.preventDefault();
});
这是我的代码表单,但提交后未发送.
this is my code form is submit but post request is not send.
推荐答案
亲爱的renishkhunt,请尝试以下代码.这对我完全有帮助.
dear renishkhunt please try this code. this is help fully for me.
$("#pitch_image_path_form").ajaxSubmit({ success: function(){
$.post("submit_investorform.php",{'flage':'getallimagesfromselectedid','form':'pitch_image_path_form'},function(result){
$("#pitch_image_path_showalldatafromid").html(result);
});
} });
请检查此链接,这是教程.
please check this link this is tutorial.
http://malsup.com/jquery/form/
这篇关于jQuery提交表单后发送帖子请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文