<form name="testform" method="post" action="add.php">
<input type="text" name="username" id="username"/>
<input type="text" name="tel" id="tel" />
<nput type="submit" name="send" value="提交訂單" onclick="return CheckForm()"/>
</form>
//fmcheck.js
function CheckForm(){
var username = document.getElementById("username").value;
var tel = document.getElementById("tel").value;
var info="您好,您訂購的信息為:姓名:"+username+",電話:"+tel;
alert (info);
}