确认表单提交HTML/Javascript后刷新页面

确认表单提交HTML/Javascript后刷新页面,javascript,forms,form-submit,page-refresh,confirmation,Javascript,Forms,Form Submit,Page Refresh,Confirmation,在用户确认要提交表单后,我尝试刷新/重新加载页面。我尝试了几种方法。在用户在弹出确认框中选择“确定”后,可以获取要提交的表单,但页面随后不会刷新。不知道第二个函数是否出于某种原因没有运行 <button class="form-button" type="submit" onclick="return confirmation();">Submit</button> <script> var a=

在用户确认要提交表单后,我尝试刷新/重新加载页面。我尝试了几种方法。在用户在弹出确认框中选择“确定”后,可以获取要提交的表单,但页面随后不会刷新。不知道第二个函数是否出于某种原因没有运行

<button class="form-button" type="submit" onclick="return confirmation();">Submit</button>

<script>

var a=foo.form.submit();
var b=window.location.reload();

function confirmation() {
if (confirm("Confirm booking")) {
a;
b;
} else {
return false;
}
}

</script>
提交
var a=foo.form.submit();
var b=window.location.reload();
功能确认(){
如果(确认(“确认预订”)){
A.
B
}否则{
返回false;
}
}
也试过

<button class="form-button" type="submit" onclick="return    
confirmation();">Submit</button>

<script>

function confirmation() {
if (confirm("Confirm booking")) {
foo.form.submit();
window.location.reload();
} else {
return false;
}
}

</script>
提交
功能确认(){
如果(确认(“确认预订”)){
foo.form.submit();
window.location.reload();
}否则{
返回false;
}
}