home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / MS_DEV / VID / SERVER / ASF / DATA.Z / form.asp < prev    next >
Text File  |  1996-09-20  |  2KB  |  78 lines

  1. <%
  2. On Error Resume Next
  3.  
  4. If Request.Form("hname") = "" Then
  5.  
  6.   ' This part of the script allows a person
  7.   ' to enter data on an HTML form.
  8. %>
  9.  
  10. <HTML>
  11. <HEAD><TITLE>Form Sample</TITLE></HEAD>
  12. <BODY>
  13. <H3>Form Sample</H3>
  14. <HR>
  15.  
  16. <P>This sample shows how to use the Request collection 
  17. to get information from a posted form.
  18. <FORM METHOD=POST ACTION="form.asp">
  19.  
  20. <P>Your Name:
  21.  
  22. <P><INPUT TYPE=TEXT SIZE=50 MAXLENGTH=50 NAME="name"><BR>
  23.  
  24. <P>Movies that you like: (you may select more than one)
  25. <SELECT NAME="movies" MULTIPLE SIZE=3>
  26. <OPTION SELECTED> Jurassic Park
  27. <OPTION> The Usual Suspects
  28. <OPTION> Jacob's Ladder
  29. </SELECT>
  30.  
  31. <INPUT TYPE=HIDDEN NAME="hname" VALUE="hvalue" ><BR>
  32.  
  33. <P>Why do you like the movies you've selected?
  34.  
  35. <P><TEXTAREA NAME="describe" ROWS=5 COLS=35></TEXTAREA><BR>
  36.  
  37. <P><INPUT TYPE=SUBMIT VALUE="Submit Form"><INPUT TYPE=RESET VALUE="Reset Form">
  38. </FORM>
  39. <HR>
  40. <BR>
  41. </BODY>
  42. </HTML>
  43.  
  44. <% Else
  45.  
  46.   ' This part of the script shows a person
  47.   ' what was selected.
  48. %>
  49. <HTML>
  50. <HEAD><TITLE>Form Sample</TITLE></HEAD>
  51. <BODY>
  52. <H3>Form Sample</H3>
  53. <HR>
  54. <BODY>
  55.  
  56. <% If Request.Form("name") = "" Then %>
  57.   <P>You did not provide your name.
  58. <% Else %>
  59.   <P>Your name is <B><%= Request.Form("name") %></B>
  60. <% End If %>
  61.  
  62. <% If Request.Form("movies").Count = 0 Then %>    
  63.   <P>You did not select any movies.
  64. <% Else %>
  65.   <P>The movies you like are:  <B><%= Request.Form("movies") %></B>
  66.  
  67.   <% If Request.Form("describe") = "" Then %>
  68.     <P>You did not say why you like the movie(s) you have selected.
  69.   <% Else %>
  70.     <P>Your description of why you like the movie(s) is:
  71.     <B><I><%= Request.Form("describe") %></B></I>
  72.   <% End If %>
  73. <% End If %>        
  74.     
  75. </BODY>
  76. </HTML>
  77.  
  78. <% End If %>