我已經詢問了某些信息,然後驗證使用javascript實際上它提交給一個單獨的PHP文件的形式提交email給我然而,在成功提交表單前形式的基本形式,它進入空白頁面,然後出現一個謝謝彈出窗口。如何設置它,以便按下提交按鈕不會進入新頁面,而只是在當前頁面上顯示彈出窗口?表單提交對話框
我對填寫表單代碼:
<form action="send_group.php" method="post" onsubmit='return formValidator()'>
//Asks to input information
<input type="submit" value="Submit" />
</form>
我的PHP代碼:
<?php
$webmaster_email = "[email protected]"; //E-mail the message will be sent to
$info = $_REQUEST['info'] ;
$info1= $_REQUEST['info1'] ;
$info2= $_REQUEST['info2'] ;
$info3= $_REQUEST['info4'] ;
mail("$webmaster_email", "Information Form Submission",
"Info: $info
Info1: $info1
Info2: $info2
Info3: $info3");
echo "<script type='text/javascript'>\n";
echo "alert('Thank you for your booking request. We will get back to you as soon as possible.');\n";
echo "</script>";
?>
這正是我所期待的。謝謝! – 2012-07-31 16:25:49