A summary of how jquery implements form forms by Ajax _jquery

Source: Internet
Author: User

Method One:

Copy Code code as follows:

function Addhandlingfeetorefund ()

{
var ajaxurl= ". /ordermanagement/ajaxmodifyorderservice.aspx ";
Alert ($ (' #formAddHandlingFee '). Serialize ());
$.ajax ({
Type: "POST",
DataType: "HTML",
Url:ajaxurl + '? action= ' + ' submithandlingfee ' + ' &ordernumber= ' + $.trim ($ ("#<%=this.txtordernumber.clientid%>"). Val ()),
Data: $ (' #formAddHandlingFee '). Serialize (),
Success:function (Result) {
var Strresult=result;
alert (strresult);
Load Maximum fallback amount
$ ("#spanMaxAmount"). HTML (strresult);
},
Error:function (data) {
Alert ("Error:" +data.responsetext);
}

});

}


Method Two:
Copy Code code as follows:

How Ajax submits form forms
$ (' #formAddHandlingFee '). Submit (function () {
var ajaxurl= ". /ordermanagement/ajaxmodifyorderservice.aspx ";
Alert ($ (' #formAddHandlingFee '). Serialize ());
$.ajax ({
Type: "POST",
DataType: "HTML",
Url:ajaxurl + '? action= ' + ' submithandlingfee ' + ' &ordernumber= ' + $.trim ($ ("#<%=this.txtordernumber.clientid%>"). Val ()),
Data: $ (' #formAddHandlingFee '). Serialize (),
Success:function (data) {
var strresult=data;
alert (strresult);
Load Maximum fallback amount
$ ("#spanMaxAmount"). HTML (strresult);
},
Error:function (data) {
Alert ("Error:" +data.responsetext);
}

});
}

);


Page HTML code:
Copy Code code as follows:

<form id= "Formaddhandlingfee" name= "Formaddhandlingfee" enctype= "Multipart/form-data" Addhandlingfeetorefund () ">
<table id= "Addhandlingfee" class= "Wfill" >
<tr>
<td>
<asp:literal id= "Ui_amount" runat= "Server" text= "processing costs" meta:resourcekey= "Handlingfeeamount"/>
</td>
<td>
<input type= "text" id= "Txthandlingfeeamount" name= "Txthandlingfeeamount" class= "{required:true,number:true}" Maxlength= "/>"
</td>
</tr>
<tr>
<td>
<asp:literal id= "Ui_handlingfeetype" runat= "server" text= "expense type" meta:resourcekey= "Handlingfeehandlingfeetype"/ >
</td>
<td>
<crmweb:htmlselectcontrol id= "Handlingfeetype" Enumtypename= DX. OMS. Model.common.handlingfeetype,dx. OMS. Model.common "emptyvalue=" "emptytext=" select "runat=" Server "class=" text {required:true} "/>
</td>
</tr>
<tr>
<td>
<asp:literal id= "ui_notes" runat= "Server" text= "Remarks" meta:resourcekey= "Handlingfeenotes"/>
</td>
<td>
<textarea id= "txtnotes" name= "txtnotes" class= "text {required:true}" cols= "rows=" "2" maxlength= "The ></" Textarea>
</td>
</tr>

<tr>
<td>
</td>
<td>
<input id= "Submit1" type= "Submit" value= "Add processing fee"/>
<asp:button id= "Button1" runat= "Server" text= "Add processing fee" onclientclick= "Javascript:addhandlingfeetorefund ()"/>
</td>

</tr>
</table>
</form>

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.