Log in

View Full Version : Asp Form With Three Actions on Submit



dubosegriffin
10-28-2010, 02:28 AM
Greetings,

I am new to ASP. I have coded a basic form that collects information and then sends that information to the webmaster and the individual that submitted the form. However, I need this form to do at least one other task. There is a final task but I will describe that later.

First - my test form is here: http://www.manta-online.org/boatdonation.html
At this time, when the form is submitted the information is successfully emailed and then the user is redirected to a dummy thank you page. Please ignore that thank you page because this is not what I want to happen.

What I would like to happen is that when the user enters the information into the form and hits submit, two things happen: (1) some math calculations (javascript I suspect) are performed and returned to this same form html page on the right hand side, and (2) the same results from the calculations and the basic information input into the form is emailed to recipients.

Is this possible to return only the calculations to the page but email the form information and the calculations? Now specifically to the calculations, I am pretty sure I can write the javascript code for these calculations but it is also possible to use a server side data table to help with the calculations. Can this be incorporated as well. With ASP, what table format is needed?

Thank you for any starting guidance. I suspect that there is code for the submit button that will bring all this together.
Thank you,
DuBose Griffin

Dee_Veloper
02-02-2011, 09:15 PM
you can do anything but you must get the separation of clientside and serverside code in order.

use clientside javascript to control the submit button.

use clientside javascript to do any clientside calculations upon clicking the submit button.

use clientside javscript to send information to the server via ajax to do any serverside calculations which can return a value to be further used by the clientside javascript code

finally, submit the form and calculation results with clientside javascript .