I saw a post does the work: How to post XML to server thru HTML form?
<asp:Content ID="Content8" ContentPlaceHolderID="MainContent" runat="server"> <fieldset> <asp:Label ID="lblFirstName" runat="server" Text="First Name:"></asp:Label> <asp:TextBox ID="tctFirstName" runat="server"></asp:TextBox> <asp:Label ID="lblLastName" runat="server" Text="Last Name:"></asp:Label> <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox> <asp:Label ID="lblEmail" runat="server" Text="E-Mail:"></asp:Label> <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> <asp:Label ID="lblPhone" runat="server" Text="Phone Number:"></asp:Label> <asp:TextBox ID="txtPhone" runat="server"></asp:TextBox> <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> </fieldset> </asp:Content>
I saw a post does the work: How to post XML to server thru HTML form? |
$("#myform").submit(function(){ var formjson = $('#myform').serializeArray(); var formxml = json2xml(formjson); $.post("/collect.php", { 'data': formxml }, function(data){ // callback logic }); return false; });