<%@LANGUAGE="VBSCRIPT" %> <% Response.CacheControl = "no-cache" %>
Lab 3 (Due 11:59 PM Friday)

Passing Form Information from Page to Page

Instructions

This lab will give you more experience with the Request and Response Objects. You will create a form page (default) with a submit button. When this form is submitted, the form data is sent to an identical form page (getFormData) and the form data is automatically inserted into the form fields (autopopulation). This time, when the second form is submitted, it will go to a third page (displayFormData) that writes the information to the web page. This last page (displayFormData) should resemble a receipt that you would get after ordering something online.

One purpose of this lab is to get you familiar with the <%=     %> delimiter in ASP. You will use this delimiter on getFormData.asp when inserting variables into selected spots in your code. This lab will provide more experience with requestion information from a form and writing data to the browser. It will also provide more experience with declaring and initializing variables. Do not use the session object on this laboratory.

Materials to turn in on the server:

  • In your Lab03 folder
    • default.asp
    • getFormData.asp
    • displayFormData.asp
  • For PHP, in your Lab03 folder
    • default.php
    • getFormData.php
    • displayFormData.asp
Procedures
  1. default page
    • Straight HTML page (with a .asp extension)
    • Create a form that looks like this
      • Must contain all of the same form fields as in the example
      • One single form (i.e.: only 1 <form> </form> element)
    • Aesthetics are up to you, make it look professional
  2. getFormData page
    • Copy default.asp and save as getFormData.asp
    • Add the language declaration at the top
    • Before the HTML starts, Add a section of ASP that:
      • Declares a variable for each form item
      • Initializes each variable with it's corresponding form data from default.asp
    • Within the HTML below, add value attributes to the form elements
      • Use the <%=     %> delimiter to set the value (autopopulate) of each element to its corresponding variable
      • Example: <input type="text" name="companyID" value="<%=   companyID   %>">
    • Comment your code
    • What if the user does not enter any Shipping Information?????
      • You need to create the logic to copy the billing info to the shipping info in this case
  3. displayFormData page
    • List the items of the form as you would see on a receipt (similar to this)
    • Use the Response object to write the form data to the web page
      • Do it without using variables (hint: nest the Request call inside of the Response call)
    • This page can be a mix of HTML and ASP
    • Aesthetics are up to you, but the pages should follow the same scheme.
       
  4. Duplicate the laboratory in PHP
    • Use <?php echo "whatever"; ?> to set the value (autopopulate) of each element to its corresponding value
    • Example: <input type="text" name="companyID" value="<?php echo companyID; ?>">
       
    Validation & Accessibility
     
  5. Validate your pages using (a) Dreamweaver and (b) the HTML Validator add-on for Firefox. Fix any errors before turning in.
    • Pre-rendered HTML: Use Dreamweaver built-in page validation
    • Post-rendered HTML: Firefox: View source _or_ Icon on bottom / status bar > Double click for details
    • Using only Dreamweaver is not good enough
       
  6. Check accessibility issues using the Accessibility Extension add-on for Firefox. Fix failures before turning in.
    • Accessibility > Reports > Accessibility Issues
       
  7. Test it. Make sure it works!!!
     
  8. Do not modify any files after the deadline. Timestamps on all files will be checked during grading.

Grading

Coding & Comments -5 pts max
Aesthetics -2 pts max
Duplicated in PHP -1 pts max
Validate / Accessibility -2 pts max
Total 10 pts possible