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>