jquery Ajax to submit form form of two methods summary (recommended)
Method One:
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 ()), C10/>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:
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:
<form id= "Formaddhandlingfee" name= "Formaddhandlingfee" enctype= "Multipart/form-data" Addhandlingfeetorefund () "> <table id=" addhandlingfee "class=" Wfill "> <tr> <td> <as P:literal id= "Ui_amount" runat= "Server" text= "processing costs" meta:resourcekey= "Handlingfeeamount"/> </td> <t d> <input type= "text" id= "Txthandlingfeeamount" name= "Txthandlingfeeamount" class= "{required:true,number:true } "maxlength="/> </td> </tr> <tr> <td> <asp:literal id= "Ui_handli
Ngfeetype "runat=" server "text=" fee 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> </t r> <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 ></te" xtarea> </td> </tr> <tr> <td> </td> <td> <i Nput id= "Submit1" type= "Submit" value= "Add processing fee"/> <asp:button "id= Button1" runat= "Server" text= "Add processing fee" Onclien Tclick= "Javascript:addhandlingfeetorefund ()"/> </td> </tr> </table> </form>
Above this jquery Ajax to submit form form of two methods summary (recommended) is small to share all the content of everyone, hope to give you a reference, but also hope that we support cloud habitat community.