need assistance with form submit

im working on creating a small survey web form where in the user will come answer the 3 questions and then click submit.

on clicking submit the user is redirected to a page where based on the score from the answers is calculated and as per the score generated some information is loaded on the screen in the same screen (same url).

today i happend to add the feature of an email being shot to the admin + the user filling the information.

so now what is happening is : on clicking submit the user sees the results and as soon as results are viewed the page gets redirected because i have set the action to : action=actionpage.asp?action=sendmail which sends out the mail.

So I have satisfied both the parameters needed.

1) it sends the mail
2) it shows the results

however i need the mail to be sent and the results to display on the screen instead of coming back to the main screen.

submit button :

<input type="Submit" name="Submit" value="Submit"
onClick="Javascript:Scores()">

and form :

<form name="form1" method="post" action="actionpage.asp?Sendmail">

if there is anyway else i can have this done even with redoing the entire form, please let me know.

basic needed :

1) user visits form -
2) submits answers - (radio buttons only)
3) on submit ---> based to the total of all the 'values' of the selected radio button information is shown on the screen.
4) an email is sent with the results and the values selected.

:no: my gut feeling says this has to be restructured from the beginning but due to limited knowledge on this im totally relying on tutorials and information available on google.
 
thetechmind said:
basic needed :

1) user visits form -
2) submits answers - (radio buttons only)
3) on submit ---> based to the total of all the 'values' of the selected radio button information is shown on the screen.
4) an email is sent with the results and the values selected.

just swap steps no 3 & 4. when the answers are submitted, first send the email and from the email module set the action as calculate/display to display the results.

or use 2 action params
action & nextAction.

what are you language are you using for server side programming?
 
how do you fetch the results to display? and what about the email part?

there must be some server side code?

i am a j2ee person, so cant say much about asp, but one more thing i can suggest is if there is something like request.forward then first use the action and next action

set action=sendEmail

& next action to display results or whatever

uses hidden fields for setting these variables during form onSubmit() event/or on click of submit button

in the action=email code, after sending the email, read the next action param and set that as action

then do request.forward(same page/url).

the same page will be called, it will now get the diplay as action and will display the results

hope this helps.
 
^ i appreciate ur responses. but i'm still clueless how do i do this :( spent endless number of hours. another issue i ran into right now is - i added the email field. on adding the email field if the user enters invalid data - email address the code stops working and the submit button does nothing and if i put a validation then the email code stops working.

the result is being displayed via JavaScript and the email is using actions=sendemail like u said.
 
Back
Top