Solved

Contact page with acknowledgement page

Posted on 2013-11-11
7
236 Views
Last Modified: 2013-11-24
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.
0
Comment
Question by:redrose43311
[X]
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
  • 2
7 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39640108
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?
0
 

Author Comment

by:redrose43311
ID: 39640150
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.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39640400
This page shows you the basics: http://www.w3schools.com/asp/asp_inputforms.asp
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 33

Expert Comment

by:Big Monty
ID: 39641663
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
0
 

Author Comment

by:redrose43311
ID: 39643420
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>
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 39643498
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
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 250 total points
ID: 39644950
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
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

691 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