Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
  • 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.
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.


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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

581 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