Need to confirm form data before submitting data to database

Posted on 2003-02-18
Medium Priority
Last Modified: 2013-12-24
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.
Question by:jamesjs
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 14

Accepted Solution

hhammash earned 750 total points
ID: 7984086

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.

LVL 10

Expert Comment

ID: 7994586
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.... :-)

Author Comment

ID: 8009771
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.
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more


Author Comment

ID: 8025486
This gave me the information I need to get the data to the second form.  
LVL 14

Expert Comment

ID: 8052483
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
LVL 14

Expert Comment

ID: 8053062
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.


Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
Suggested Courses

800 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