Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirmation Page

Status
Not open for further replies.

jedel

Programmer
Jan 11, 2003
430
AU
Hi all,

I'm sure I'm missing something or not usig the right search parameters. Problem is this forum is so huge and full of informtion, It's hard to tell what I'm looking at.

Can anybody step me through, or show me where to go to step through the creation of a confirmation page?

I have a number of forms on a website that go into various databases. What I would like to do is go from the form to a confirmation page which when submitted, will place it into the database.



-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
What you appear to be asking for is both rather simple and yet rather complex to explain easily. You want to take the values entered onto a form and then submit them to a database. There are several steps involved and you have shown no code which would indicate where you are in the process. At this point, the best we can offer are generalities that will hopefully help you to get started.

First, you would submit the page (with the form) to the next page (page2). Then, on page2, you can check to see if there is data in the form and do whatever you want to do with it.
Code:
if request.form("mySubmitButton") then
  [COLOR=green]'create the set of data that will be inserted into the DB.
  'Take this data and create a connection that will insert the data into your database.[/color]
else
  [COLOR=green]'else you have a problem and you need to do something else[/color]
end if
If you have more specific questions, you will have to ask with more specific data or code to reference.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Yes I was being general. I know how to get the data into the database from "page 1", containing the form. What I am after is moving that data to a confirmation page and then back again if it needs changing.

I was thinking something along the lines of loading the data from page 1 into the db, and then sending the data to page two. If it needs updating open a third page and update the data on the database.

I didn't post any code because I don't have any code to post. I really don't know where to begin in transferring data from one page to the next...

If we could start at the beginning, that would be awesome!

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
Passing the data between multiple pages can be arduous. You might want to consider a slightly different architecture to handle this, by combining the confirmation screen, validation screen, and display for re-entry of data into a single page.

If you place your initial input screen in an include file, you will be able to re-use it in multiple places. For each of the inputs you can do a check to see if a value has been posted for it and set the value attribute if it has. When the user first sees this screen they will have an empty form to fill out, if you later include it for re-entry, their previous inputs will populate it.

Page 1:
include the form

Page 2:
If nothing was submitted, response.Redirect to page 1

Declare a boolean for an error flag and set it to false
Declare an error string

Validate each form input. If there is an error set the flag to true and add text to the error string

After validation:
If the error flag is set
display your header and so on
display a message box explaining an error occurred with the error string
include your input form
output your footer and do a Response.End to finish processing the page

To get this far there must not have been errors:
Process your database inserts or updates
Display a header, a confirmation message, and a footer

You may also want to throw in a db check as the last step of validation to make sure this record hasn't already been inserted (refresh button) and output an error of "You have already submitted that informaiton" or somethign like that.

-T



Best MS KB Ever:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top