Tips for submitting multiple forms using jQuery and tips for using jquery forms
<Script type = "text/javascript"> $ (function () {$ ("# btnSubmit "). click (function () {$ ("form [name = 'form1 ']"). submit (); $ ("form [name = 'form2']"). submit ();})}) </script> <form name = "form1" action = "handleForm1Action"> </form> <form name = "form2" action = "handleForm2Action"> </form> <button id = "btnSubmit"> submit <button>
Jquery AJAX submits multiple FORM forms
If a form is submitted, the page will jump forcibly. You cannot submit multiple forms unless you specify the submission path for the form, as shown in figure
<Form name = "form1" action = "a. php" method = "post" target = 'xxxx'> </form>
<IFRAME id = 'xxxx' name = 'xxxxx' src = "" width = "220" height = "220"> </IFRAME>
This is to redirect form submission to iframe, and the page will not force redirect
$ (Document). ready (function (){
$ (Function (){
$ ('Form'). each (function (){
$ (This). submit ();
});
});
});
Multiple forms are involved in the ajax submission page of jquery.
Write the form separately. Each form gives a different ID. The ID is used for the content in the form you want to submit.