An example of JavaScript to prevent repeated submission of forms, javascript forms
<! DOCTYPE html>
How to use javascript to prevent repeated submission of forms
<Script language = "" javascript "">
Var checkSubmitFlg = false;
Function checkSubmit (){
If (checkSubmitFlg = true) {return false; // After the form has been submitted once, checkSubmitFlg changes to true, and cannot be submitted based on judgment.
}
CheckSubmitFlg = true;
Return true;
}
</Script>
<Form name = "form1" method = "post" onsubmit = "return checkSubmit ();">
........... </Form>
Why does the javascript I wrote in html not prevent repeated submission of forms?
If you want to disable the re-submission when the submission form is in progress, you can disable the button in dosubmit. We recommend that you use jquery. cookie to determine if you want users to submit the application again after the submission (which is restricted by HTML pages at the same time.
If your code does not show your expectation, you can try placing dosubmit () on The onclick page of the submit button, and add form in dosubmit. submit ().