home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / ScriptBuilder / NOSB30_TRIAL.exe / data1.cab / Program_Files / Sample / Asp / FORM.ASP < prev   
Encoding:
Text File  |  1998-10-05  |  1.8 KB  |  73 lines

  1. <%
  2. '////////////////////////////////////////////////////////////////////
  3. '//                                                                //
  4. '//   NetObjects ScriptBuilder ASP Samples    //
  5. '//   Sample : Handling data from forms using  // 
  6. '//            the Request collection                    //
  7. '////////////////////////////////////////////////////////////////////
  8.  
  9. ' DESCRIPTION: This sample shows how to use the Request collection 
  10. '     to get information from a posted form.
  11. %>
  12.  
  13. <HTML>
  14. <HEAD><TITLE>Form Sample</TITLE></HEAD>
  15.  
  16. <%
  17. If Request.Form("isFormFilled") = "" Then
  18.  
  19.   ' This part of the script allows a person
  20.   ' to enter data on an HTML form.
  21. %>
  22.  
  23.      <BODY BGCOLOR=#FFFFFF>
  24.      <H3>Form Sample</H3>
  25.      <HR>
  26.  
  27.  
  28.      <P>This sample shows how to use the Request collection 
  29.      to get information from a posted form.
  30.      <FORM METHOD=POST ACTION="form.asp">
  31.  
  32.      <P>Your Name:
  33.  
  34.      <P><INPUT TYPE=TEXT SIZE=50 MAXLENGTH=50 NAME="name"><BR>
  35.  
  36.      <P>Background color you like:
  37.      <SELECT NAME="bgColor" SIZE=3>
  38.      <OPTION SELECTED> white
  39.      <OPTION> red
  40.      <OPTION> blue
  41.      </SELECT>
  42.  
  43.      <INPUT TYPE=HIDDEN NAME="isFormFilled" VALUE="yes" ><BR>
  44.  
  45.      <P>Why do you like this color?
  46.  
  47.      <P><TEXTAREA NAME="describe" ROWS=5 COLS=35></TEXTAREA><BR>
  48.  
  49.      <P><INPUT TYPE=SUBMIT VALUE="Submit Form"><INPUT TYPE=RESET VALUE="Reset Form">
  50.      </FORM>
  51.  
  52.  
  53. <% Else
  54.  
  55.   ' This part of the script shows a person
  56.   ' what was selected.
  57. %>
  58.  
  59.      <%= "<BODY BGCOLOR=" + Request.Form("bgColor") + ">" %>
  60.  
  61.      <P>Your name is <B><%= Request.Form("name") %></B>
  62.  
  63.     <P>The reason why you like <%= Request.Form("bgColor") %> is:
  64.     <B><I><%= Request.Form("describe") %></B></I>
  65.  
  66. <% End If %>
  67.  
  68. <BR>
  69. <BR>
  70. </BODY>
  71. </HTML>
  72.  
  73.