Tips for submitting multiple forms using jQuery and tips for using jquery forms

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.