Building & Managing Web Sites with Microsoft Technologies
Lab 10 - Interactive ASP Form

 
    Home   Lectures   Labs   Resources   Discussion   Search  
In this lab you will create interactive form using Active Server Pages that will calculate a user's readiness for the Year 2000.

For this lab the values are hardcoded into the form, for the next lab the captions and values will be gotten form a database and the class will use ADO recordsets to populate the display.

Goals:

- Learn to get data from a 'POST' type form using the request.form() collection.
- Learn to use command line parameters (URL arguments for ASP) and the request.querystring() collection to display the form differently.
- Learn how to code Combo boxes, Check Boxes and Text Boxes.
- Use a good sampling of the VBScript language (dim, for, if, functions).

Instructions:

You will replicate the y2k Preparedness form as closely as you can. You may take liberty with the specific messages but not the values or calculations.

Calculations:

1. The values in the selected combo boxes are all added together and displayed.
2. Then the values in the associated checkboxs are added as a bonus
3. Then the "readiness" percentage is calculated as follows (Total of Combo Boxes + Total of Check Boxes)/(35,000)
4. Using the calulated "readiness" percentage, output a suitable assesment message (Table follows)

Percentage Message
Negative Numbers Snotty "You're Dead" Message of your choice
< 50 % Advice to prepare more
< 80 % Slightly more encouraging advice
< 110 % Indication they are ready
More then 110% Very positive message

5. Then produce a table showing the dwindling essential supplies over time. Your output should look like the example.

For the purposes of estimation, you may assume that:
   Food decreases by 1 unit per month
  Water decreases by 30 units per month
   Smokes decrease by 4 units per month

Clues:

You will use all of the following:
Response.Write()
Request.QueryString()
Request.Form()
If Then Else End If
For Next
Dim
FormatNumber()
cLng()

Lots of different attributes!

Reference:

http://msdn.microsoft.com/scripting/vbScript/doc/vbstoc.htm

This lab is due at the beginning of class on Monday, May 3rd.  E-mail the ASP page to Stuart at blitzkrieg_software@msn.com .

[csc96b/_private/footer.htm]