如何将注册表单数据发布到服务器URL。以及将用户重定向到其他站点,如感谢页面。使用javascript或ajax
除了我没有答案外,还有很多讨论。我正在向后端python脚本发布一个html表单。但是,我需要将用户重定向到感谢页面或其他地方。python脚本只使用表单数据。我也不喜欢ajax或javascript。以下是我所拥有的并希望得到的建议如何将注册表单数据发布到服务器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
<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>