Jquery Form form Submission

Source: Internet
Author: User

Cause

Because the original submission from the project from is through JavaScript to specify the action, submitted in submit, the use of the way, is not very standard, resulting in a browser other than IE does not normally submit data, do Web projects or to consider the browser compatibility.

1. Serialization of form, submitted via Ajax

   $.ajax ({            cache:false,            type: "POST",            URL: "readimage.do",            Data: $ (' #ff '). Serialize (),  // Serializes the form data            async:true,                 //is asynchronous, the default is asynchronous            success:function (data) {              if (data = = "OK") {                  Window.parent.closeTab ("Read Information", "Remote reading", "Dosearch ();");                  return false;              }              else {                  alert ("Failed to submit data, please resubmit!");                  return false;}}     );

2.Jquery easyui Form form plug-in

  $ (' #ff '). Form (' Submit ', {                URL: "Requestform.ashx",                success:function (data) {                    alert (data)                }  );

3.Jquery Form Plugin

$ ("#ff"). Ajaxsubmit ({                    URL: '). /requestform.ashx ',                    success:function (data) {                        alert (data);                    }});

1. The first way to submit form form data, because this controllability is relatively large, want to asynchronous asynchronous, want to synchronize synchronization 2. The second way, although simple, controllability will not be so big, type= "submit" can be submitted 3. You can use the jquery form form plug-in, Similar to the second approach, type does not need to submit data

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.