test.php
<form method="post" onsubmit="return CheckFormSubmit();" action="Submit.php" target="target_message">
<div class="ct_msg fl">
Country:
<input name="txtCountry" type="text" class="msg_txt" placeholder="I'm from ..." /><br />
Company Name:
<input name="txtCompany" type="text" class="msg_txt" placeholder="I work in ..." /><br />
Contact Person:
<input name="txtName" type="text" class="msg_txt" placeholder="My name is ..." /><br />
E-Mail:<font color="#f67c77">*</font>
<input name="txtEmail" type="email" class="msg_txt" placeholder="My email is ..." required /><br />
Message:<font color="#f67c77">*</font>
<textarea name="txtContent" class="msg_txt2" placeholder="I want to get the support for..." required /></textarea>
<div class="dy_sbk">
<input style="float: left;" type="submit" value="提交" id="Button1" class="dy_sb">
</div>
</div>
</form>
<iframe name="target_message" id="target" width="500px" height="300px"></iframe>
<script>
var IsSubmited = false;
function CheckFormSubmit() {
if(IsSubmited==true) return false; //如果为正在提交状态,则不允许再次提交
IsSubmited = true; //更改为提交状态
console.log('执行了一次');
return true;
}
console.log(IsSubmited);
</script>
Submit.php
<?php
if( $_POST ){
var_dump($_POST);
}
?>