我有一些基本的html表單和一些輸入。我的文件是「form.php」,一旦數據發送到表單,我想做一個彈出窗口,然後重定向到我的主頁。無論出於何種原因,該代碼PHP表單重定向不起作用
<script>
document.getElementById("myForm").addEventListener("submit",function(){
alertIt();
return redirect();
},false);
function redirect(){
window.location.replace = "index.html" ;
}
function alertIt(){
alert("Thank you for your feedback!");
}
</script>
導致工作彈出,但一旦彈出窗口,它需要我"/form.php"
而不是重定向我的index.html。任何幫助,將不勝感激。
'window.location.replace'? – Oleg