Need to confirm form data before submitting data to database

I created a form that when the users hit's the submit button the users get a confirmation page and data goes into a database. THis works fine except if they make a mistake.

I would like to make a confirmation page that shows the data the users has inputed into the form but does not go into to the database.  Then the users could check the data and if there was a mistake they could push the back button to fix any errors.  If all data was fine they could push the submit button which would enter the data into the database and give them a confirmation page to tell them the data was submited successfully.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


1- Keep your first form as it is
2- Create a New form that Picks up the data from the first form
3- Post the first form to the second form
4- The second form Writes to the database
5- After writing to the database a confirmation page comes.

All pages should be .asp

So, what happens is: When the user fills the first form and submits,  the data goes into the second form which has text fields reading the data from the first form,  these text fields are editable.  In this form you ask the user if he/she is sure,  if yes, they will hit submit button to go to the database.

Suppose the first form has a field called Name,  the second form should have a field called name,  with the value set up to:<%=Request.form("Name")%>, this should be in all field values in the second form. Of course it should be <%=Request.form("FieldName")%>.  This way you will have a second form,  ready filled from the first one,  with the ability to edit in case of any mistake before submitting it to the database.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Using this method you can also set fields to be mandatory and check to be sure the format of the info is correct.  Here's a small example using ASP:

error_message = ""

If contractor = "" Then
     error_message = ("<p>You have to include the primary contractor.</p>")
End If

If Len(dob)>1 and IsDate(dob) = False Then
     error_message = ("<p>Date of birth is invalid</p>")
End If

If Len(ssn)>1 and Len(ssn)<>9 Then
     error_message = ("<p>The Social Security number must be 9 digits</p>")
End If

If error_message <> "" Then
     Response.write("<html><head><title>Error messages</title></head><body>")
     Response.write("There was an error in your form. Press your browsers BACK button...")
Else ....

I guess you figured out that this is pretty much impossible just using FrontPage.... :-)
jamesjsAuthor Commented:
I have taken your suggestion hhammash and now I have the second page filled out but I cannot get the second page to post to the database and get a confirmation page.  When I hit submit I just see thae second page again with no information.  I'm thinking I need to use the code <%
to get confirmation info on the page.  That would be fine but why is not talking to my database?  

One piece of info that I left out was that I built this with FRONTPAGE 2002.

Thank you.
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jamesjsAuthor Commented:
This gave me the information I need to get the data to the second form.  
Hi Jamesis,

You are welcome,  I am glad it worked.

In FrontPage,  you can go to Insert/Web Component/Advanced Controls/Confirmation Field.  This will enable you create a confirmation page.

Of course the Request.form will enable you do that too.

Best regards
Hi Jamesjs,

I tried it <%=Request.form("FieldName')%>

It will work for sure. The first form should be ASP and the second should be ASP too.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.

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.