Solved

Confirmation Page - Form

Posted on 2001-08-20
14
389 Views
Last Modified: 2012-06-27
How can I have a confirmation page to show up after a form has been submitted?  I played around with "onsubmit" -- but I want it to show up AFTER the data has been submitted, not right before...

Thanks
0
Comment
Question by:Methos
  • 7
  • 3
  • 2
  • +1
14 Comments
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6408586
If you want to get a confirmation page you will need some sort of Server-Side processing....this could be a script hosted somewhere else. (mostly these are Perl) If you decide to use one of those your form will look something like this (please note that this example is not using an existing perl script)

<form method="post" action="http://www.someperlsite.com/sendmail.pl">
...
...
//These contain your regular form fields...
<input type='hidden' name='followuppage' value='confirm.html'>
</form>

Something like this....there are many of these around....ofcourse you could also choose to play around making your own server side script...for that I would need to know if you are running a UNIX server or a Windows Server...

Cheers,
Max.
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 50 total points
ID: 6409095
If you're using ASP...(so running on Windows NT, 2000) you could use something like this...

First you get the form:

<html>
<head>
<title>Give your feedback</title>
</head>
<body>
<form action="sendmail.asp" method="post">
 <input type="textbox" name="inpFName"><br>
 <input type="textbox" name="inpLName"><br>
 <input type="textbox" name="inpEmail"><br>
 <textarea name="inpResponse" cols="40" rows="5"><br>
 <input type="submit" name="submit" value="Send!">
</form>
</body>
</html>

The sendmail.asp page would look a little something like this:

<%
  inpFName = Trim(Request.Form("inpFName"))
  inpLName = Trim(Request.Form("inpLName"))
  inpEmail = Trim(Request.Form("inpEmail"))
  inpResponse Trim(Request.Form("inpResponse"))
 
  set oMail = CreateObject("CDONTS.Newmail")
  oMail.To = "youremail@address.com"
  oMail.From = inpEmail
  oMail.Subject = "Feedback op de site"
  oMail.Body = inpReactie
  oMail.Send
  set oMail = nothing
%>

<HTML>
<HEAD>
<title>Your feedback</title>
</head>
<body>

<p>Thanks for giving us your feedback..we do appreciate it. The following message was send by you:</p>

<p>
<b>From:</b> <% Response.Write (inpEmail) %><br>
<b>Subject:</b> <% Response.Write "Feedback op de site" %><br>
<b>Response:</b> <% Response.Write (inpResponse) %>
</body>
</html>

Note that this is very basic...and it's just an example to show you how easy it can be.. :)

Max.
0
 
LVL 1

Expert Comment

by:james_beilby
ID: 6409383
An alternative you might like to try is opening up the confirmation page in a new window - note that this is immediate and does not wait for the form to be processed by the server-side script...

<form ... onSubmit="window.open('thankyou.htm','ty','width=200,height=150,menubar=0,statusbar=0');">
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 19

Expert Comment

by:DreamMaster
ID: 6409391
Yes....and that is what he asked for james_beilby....

"I want it to show up AFTER the data has been submitted"

But still...what you suggested remains a good suggestion... :)

Max.
0
 
LVL 1

Expert Comment

by:james_beilby
ID: 6409488
Hence why it's an "alternative" :-)
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6409526
Indeed...

Methos > Did our suggestions help you in any way?

Don't hesitate to ask for our help if you need it ok?

Max.
0
 

Author Comment

by:Methos
ID: 6409854
Sorry -- I just got all the suggestions and haven't had time to even read through them all yet! :)

I'm putting the form up on a client's Intranet -- which is very limited in what they allow you do.  I may be limited to straight html.  I think the company standard desktop is W2k.  If this is the case - can I try the .asp?   If not, I'll use the alternate 'onsubmit' and tell them I can't get the confirmation page AFTER sending.

I'm going over there later this morning and will test a few things and get back to you.

Thanks!
Methos
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6409869
What matters is the server...is that running on 2000? And if so can't they allow you to send mail through a script? You have to give the advising role and tell them it would work much better that way..

And then even if you cannot process it server-side on your own server, there is still the option I mentioned before of using an external processing script....on an external server....

Which ever suits your needs...

Max.
0
 
LVL 1

Expert Comment

by:james_beilby
ID: 6410325
Here's another clientside one...

Load the page with the form on ("form.htm") inside a larger frame:

<html>
<head>
<script>
function checkChild(){
  if((window.frames[0].location.href).indexOf("submit.asp")>-1){
    window.open("thankyou.htm","ty","width=200,height=150,menubar=0,statusbar=0");
    clearInterval(processedCheck);
  }
}

processedCheck = setInterval("checkChild()",100);
</script>
</head>
<frameset rows="100%,*" border="0" frameborder="no" framespacing="0">
<frame src="form.htm">
</frameset>
</html>

This will launch the thankyou window after the form is submitted (or when submit.asp appears). The line:
     window.open("thankyou.htm","ty","width=200,height=150,menubar=0,statusbar=0");
could be changed to:
     window.frames[0].location.href = "thankyou.htm";
which would then replace the output from the server-side script with the thankyou.htm (or confirmation) page.
0
 

Author Comment

by:Methos
ID: 6411992
Here's how I ended up solving this for now...

<form action="mailto:name@company.com?subject=re: subject line" method="POST" enctype="text/plain" name="Signup" onsubmit="return checkData()"


 function checkData (){
                                if (document.Signup.Employee_Name___.value == "") {
                                        alert("Please fill in your name.")
                                        document.signup.Employee_Name___.focus()
                                        return false}
                                if...    (blah blah blah if statements)
                                 

                                else
                                {window.location="Thankyou.html"}



and I redirect the user off the Thankyou.html page...


I had to get this up and working today and this seems to work for now.  I would like to explore both of your alternatives in the future and both of you helped my getting it done.  Is there a way to slip the points?

- Methos
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6412444
Split you mean I guess...yes there is...

Go to community support section of this site...ask them to lower the amount of points here to 50...and then ask a new question in the form:

"Question for <Expert Name> for help on <QID>"

Then you can accept one of our comments here...and the other will have a question with points in his name...

Max.
0
 

Expert Comment

by:ComTech
ID: 6420346
Methos has reuqested a 50/50 points split here. I will refund 50 points to start the split and accept for DreamMaster for 50 points.

Methos, to complete the split, you must open a NEW question in this Topic Area entitled *Points for james_beilby*  In the comment box, type *For your help in solving my question #20171387*  Then click on the 50 point button and Submit.  The split will be complete.

Thanks,
ComTech
Community Support
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6420968
Glad I was able to help...

Cheers,
Max.
0
 

Expert Comment

by:ComTech
ID: 6422047
Good job Methos, we are all done here now.

Thanks,
ComTech
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to loop bootstrap columns which contain database records 9 37
Put shading on half of picture 8 42
HTML5 frame 5 25
ASP server side get value 15 20
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

776 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