Ok I am going to try and explain this as best as possible. Here is what I am trying to do. Because we have a content management system - I am not able to access the .NET files that call all functionality to our pages.
My question is can I use jQuery to simulate the form submission and populate a div tag with the results?
I do not want to send any form information, validate any form information etc. This is already all done on the ASP side.
If you look at the code I provided you'll see the ASP code I have to use is all runat=server, and the form has no action for any script to post to. This is how our system is set up and I cannot change it. When the page loads, a __postBack appears within the link's HREF field. I've heard postBacks are messy and I want to know what can be done
I want everything to work as it does now, however I just don't want to leave the page.
- User comes to index page and fills out 3 form fields and hits submit
- NORMALLY this user would then validate through a validation page, and be kicked back index page saying they need to fill out more required form fields
- Keep in mind using jQuery I do not want to handle the data at all - I just want to pass the form process through a div layer... so that the user does not have to leave the page.
- My goal is when the user submits the form the page does not need to reload
The code I provided cannot be greatly modified so please try to work with what is provided
I'm capable of doing a jquery "ajax" form submission in normal circumstances but my knowledge of intercepting it on a .NET level is close to none.
Please let me know if this can or can't be done
<%@ Page Inherits="LandingPages.Web.UI.Page" %>
<form id="Form1" method="post" runat="server">
<input name="Phone1" type="text" id="Phone1" style="width:30px;" runat="server" valuetype="Telephone">)
<input name="Phone2" type="text" id="Phone2" style="width:30px;" runat="server" valuetype="Telephone"> -
<input name="Phone3" type="text" id="Phone3" style="width:30px;" runat="server" valuetype="Telephone">
<input type="text" runat="server" valuetype="NameOnCard" style="width:200px;" name="NameOnCard" id="NameOnCard">
<a href="" id="a1" runat="server" valuetype="SubmitYes">CLICK ME TO SUBMIT</a>