Contact page with acknowledgement page

I have been trying to figure out how to get my contact page once filled out to show an acknowledgement page that has the users input information ( first name, last name, email, number, and comment made) along with a message.
redrose43311Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Dave BaldwinFixer of ProblemsCommented:
A contact form page needs to be submitted to a page that is programmed in a server side language like PHP or ASP to receive it and do something with it.  What language are you using on your web server?
redrose43311Author Commented:
It is to be written in ASP, I have been using Dreamweaver to write the codes for the contact form. I am new to all of this so kinda confused.
Dave BaldwinFixer of ProblemsCommented:
This page shows you the basics: http://www.w3schools.com/asp/asp_inputforms.asp
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Big MontyWeb Ninja at largeCommented:
show us what you've gotten so far with coding and ask specific questions on what you're having problems and I'm absolutely positive someone on here will help you out.

you may also want to consider adding the ASP zone
redrose43311Author Commented:
Ok I am so lost here, Now for some reason I can not get the information to validate nor load to a new page with the users input information showing. here is the code I am working with,


<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>contactform</title>
</head>

<body>
<form action="" method="post">
  <table width="481" border="2">
    <tr>
      <th width="183" scope="row">First name</th>
      <td width="280"><input type="text" name="fname" id="fname" /></td>
    </tr>
    <tr>
      <th scope="row"><label for="lname">Last Name</label></th>
      <td><input type="text" name="lname" id="lname" /></td>
    </tr>
    <tr>
      <th scope="row"><label for="email">Email Address</label></th>
      <td><input type="text" name="email" id="email" /></td>
    </tr>
    <tr>
      <th scope="row"><label for="pnumber">Phone Number</label></th>
      <td><input type="text" name="pnumber" id="pnumber" /></td>
    </tr>
    <tr>
      <th scope="row">Reason for Contact</th>
      <td><textarea name="comment" id="comment"></textarea></td>
    </tr>
    <tr>
      <th height="56" scope="row">&nbsp;</th>
      <td><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
  </table>
</form>
</body>
</html>
Dave BaldwinFixer of ProblemsCommented:
This line <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> is not needed for the code that you have.  There is no javascript on that page.

And this line <form action="" method="post"> tells the form to POST to itself.  To POST it to another page, you have put that page in the 'action' attribute like...
<form action="nextpage.asp" method="post">

Open in new window

Please read the page I linked... http://www.w3schools.com/asp/asp_inputforms.asp
Big MontyWeb Ninja at largeCommented:
i don't see any validation code, no wonder its not validating :)

you should be able to use the code below to validate all of the fields and make sure they're filled out. This uses straight-forward javascript (this seems like a learning exercise and I don't want to throw too much at you. just a FYI, using jQuery to validate would be easier as would HTML5). This form posts itself and when it does, it'll write out the data posted to the screen. you'll notice I changed the server side language to vbscript, typically server side coding is done in vbscript, and client side is done in javascript. It's not a hard and fast rule, you can code in either, but the industry standard is typically done this way.

<%@language=vbscript %>

<%
if Request.Form("button") = "Submit" then    '-- submit button was pressed
     Response.Write Your data looks like this:<br/><br/>" _
               "First Name: " & Request.Form("fname") & "<br/><br/>" _
               "Last Name: " & Request.Form("lname") & "<br/><br/>" _
               "Email:" & Request.Form("email") & "<br/><br/>" _
               "Phone Number" & Request.Form("pnumber") & "<br/><br/>" _
               "Comments:<br>" & Request.Form("comment")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>contactform</title>

<script  type="text/javascript">
     function validateForm() {
         var frm = document.form;  //-- gets the form object and assigns it to a local variable
         var validate = true;   // we check this variable at the end, if it's true, we submit
         var msg = '';

          if( frm.fname == '' ) {
             msg = 'Please fill out your first name.';
             validate = false;
             frm.fname.focus();     //-- set the focus to the invalid field
         } else if( frm.lname == '' ) {
             msg = 'Please fill out your last name.';
             validate = false;
             frm.lname.focus();     //-- set the focus to the invalid field
         } else if( frm.email == '' ) {
             msg = 'Please fill out your email address.';
             validate = false;
             frm.email.focus();     //-- set the focus to the invalid field
         } else if( frm.pnumber == '' ) {
             msg = 'Please fill out your phone number.';
             validate = false;
             frm.pnumber.focus();     //-- set the focus to the invalid field
         } else if( frm.comment == '' ) {
             msg = 'Please fill out the comments field.';
             validate = false;
             frm.comment.focus();     //-- set the focus to the invalid field
         } 

         if( ! validate )
            alert( msg );

         return validate;     // if this is false the form will not submit
     }
</script>
</head>

<body onsubmit="return validateForm();">
<form action="samepage.asp" method="post">
  <table width="481" border="2">
    <tr>
      <th width="183" scope="row">First name</th>
      <td width="280"><input type="text" name="fname" id="fname" /></td>
    </tr>
    <tr>
      <th scope="row"><label for="lname">Last Name</label></th>
      <td><input type="text" name="lname" id="lname" /></td>
    </tr>
    <tr>
      <th scope="row"><label for="email">Email Address</label></th>
      <td><input type="text" name="email" id="email" /></td>
    </tr>
    <tr>
      <th scope="row"><label for="pnumber">Phone Number</label></th>
      <td><input type="text" name="pnumber" id="pnumber" /></td>
    </tr>
    <tr>
      <th scope="row">Reason for Contact</th>
      <td><textarea name="comment" id="comment"></textarea></td>
    </tr>
    <tr>
      <th height="56" scope="row">&nbsp;</th>
      <td><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
  </table>
</form>
</body>
</html>

Open in new window


be sure to set the forms action to the name of the page in order for it to work. You can also put your confirmation page name there and use the same logic I used, except writing it to a screen, you'll probably want to save it to the database.

Hope this helps get you in the right direction

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
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
HTML

From novice to tech pro — start learning today.