Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Contact page with acknowledgement page

Posted on 2013-11-11
7
Medium Priority
?
240 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 84

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 84

Expert Comment

by:Dave Baldwin
ID: 39640400
This page shows you the basics: http://www.w3schools.com/asp/asp_inputforms.asp
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 34

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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 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 34

Accepted Solution

by:
Big Monty earned 1000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

604 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