Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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
如何将注册表单数据发布到服务器URL。以及将用户重定向到其他站点,如感谢页面。使用javascript或ajax_Javascript_Html_Ajax_Forms - Fatal编程技术网

如何将注册表单数据发布到服务器URL。以及将用户重定向到其他站点,如感谢页面。使用javascript或ajax

如何将注册表单数据发布到服务器URL。以及将用户重定向到其他站点,如感谢页面。使用javascript或ajax,javascript,html,ajax,forms,Javascript,Html,Ajax,Forms,除了我没有答案外,还有很多讨论。我正在向后端python脚本发布一个html表单。但是,我需要将用户重定向到感谢页面或其他地方。python脚本只使用表单数据。我也不喜欢ajax或javascript。以下是我所拥有的并希望得到的建议 <div class=login-content container" style="max-width: 800px;"> <form role="form" id="form" name="form"> <h2 class

除了我没有答案外,还有很多讨论。我正在向后端python脚本发布一个html表单。但是,我需要将用户重定向到感谢页面或其他地方。python脚本只使用表单数据。我也不喜欢ajax或javascript。以下是我所拥有的并希望得到的建议

<div class=login-content container" style="max-width: 800px;">
<form role="form" id="form" name="form">
    <h2 class="form-signin-heading">{{ _("One Last Step") }}</h2>


    <input name="app_name"
        class="form-control" placeholder="{{ _('app_name') }}" required autofocus><br>

    <input name="admin_password"
        class="form-control" placeholder="{{ _('admin_password') }}" required><br>


    <br>
    <button class="btn btn-primary btn-complete-signup" type="submit" >{{ _("Complete") }}</button>
</form>

看起来你已经做了。。。。除了发布数据,您还可以使用JS发布表单数据,在您的示例中,您根本不发送任何数据。请查看如何创建一个表单,特别是如何创建一个明确的问题陈述(在“可验证”下)
<script type="text/javascript">
$(function() {
  $('form').submit(function(){
        $.post('http://website.xyz/api/method/python.script.here', function() {
      window.location.href = "thankyou.html";
    });
    return false;
  });
});
</script>