Upon ASP.NET form submission have jQuery intercept and post the form response

Posted on 2008-02-06
Medium Priority
Last Modified: 2013-11-07
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" %>
<script type="text/javascript" src="javascript/jQuery.js"></script>
<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>

Open in new window

Question by:ctdigital

Accepted Solution

Lakio earned 2000 total points
ID: 20839604

;-) ant jquery cool ?

Expert Comment

ID: 21077460
Forced accept.

EE Admin

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The PowerShell Core 6.0 of .NET release is just the beginning. The upcoming PowerShell Core 6.1 would have artificial intelligence and internet of things capabilities. So many things to look forward to in the upcoming release.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question