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/