Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms 使用jQuery将页面从表单加载到模式窗口_Forms_Jquery_Jqmodal - Fatal编程技术网

Forms 使用jQuery将页面从表单加载到模式窗口

Forms 使用jQuery将页面从表单加载到模式窗口,forms,jquery,jqmodal,Forms,Jquery,Jqmodal,我正在一个有购买流程的网站上工作。我有一个由PHP生成的表单,如下所示: <form name="order_form" action="'.$thePayreadApi->get_server_url().'" method="post" id="payer-form"> '.$thePayreadApi->generate_form().' <input type="submit" value="Klicka för betalning" /> </

我正在一个有购买流程的网站上工作。我有一个由PHP生成的表单,如下所示:

<form name="order_form" action="'.$thePayreadApi->get_server_url().'" method="post" id="payer-form">
'.$thePayreadApi->generate_form().'
<input type="submit" value="Klicka för betalning" />
</form>';
提交表单后,它将转到位于另一台服务器上的新页面,在该服务器上执行购买

基本上,我想要的是通过AJAX提交表单,然后在模式窗口中加载新页面。我在整个网站上都使用jQuery,所以我想要一个基于该库的解决方案

我发现这些网站可能是一个暗示:


非常感谢您的帮助

我还没有完全尝试过这一点,但理论就是我想要的:

$("form[name='order_form']").submit(function() {

    //Validate in here
    var validate = false;
    if($("input[form='element1']").val()!="") {
        validate = true;
    }
    if(validate) {
        this.submit();
    } else {
        return false;
    }
});

<form action="shopping.php" target="targetIframe" method="post">
    <input type="submit" value="Click Me" />
</form>

<iframe name="targetIframe" src=""></iframe>

那么您可以在表单中设置目标?是的,它应该将任何响应URL发布到目标iframe中。