JQuery implements the method for determining when a form is submitted. jquery implements form submission.
This example describes how jQuery can determine when a form is submitted. Share it with you for your reference. The specific implementation method is as follows:
Copy codeThe Code is as follows: <input type = "submit" id = "myBtn"/>
Replace:
Copy codeThe Code is as follows: <input type = "button" id = "myBtn"/>
Usage:
Copy codeThe Code is as follows: $ ("# myBtn"). click (function (){
... // Verify the judgment
});
Form submission js:
Copy codeThe Code is as follows: function formSubmit (){
If (flag = "1 "){
$ ("# Form"). submit ();
} Else if (flag = "2 "){
$ ("# Form"). attr ("action", "deployResult. jsp ");
$ ("# Form"). attr ("target", "_ blank ");
$ ("# Form"). attr ("method", "GET ");
$ ("# Form"). attr ("enctype", "application/x-www-form-urlencoded ");
$ ("# Form"). attr ("encoding", "application/x-www-form-urlencoded ");
$ ("# Form"). submit ();
}
}
I hope this article will help you with jQuery-based web programming.