JScript Sample: jscript/general/form/form.asp
   ASP Script
   Comments or Client-side Script
   HTML and Text

<%@ LANGUAGE = "JScript" %>

<html>
<head><title>Form Sample</title></head>
<body BGCOLOR="#eadfdf">
<h3>Form Sample</h3>
<hr>
<%  if (Request.form("hname").count == 0) { %>



       <p>This sample shows how to use the Request collection
       to get information from a posted form.
       <form METHOD="POST" ACTION="form.asp">

       <p>Your Name:

       <p><input TYPE="TEXT" SIZE="50" MAXLENGTH="50" NAME="name"><br>

       <p>Movies that you like: (you may select more than one)
       <select NAME="movies" MULTIPLE SIZE="3">
       <option SELECTED> The Lion King
       <option> Beauty and the Beast
       <option> 101 Dalmations
       </select>

       <input TYPE="HIDDEN" NAME="hname" VALUE="hvalue"><br>

       <p>Why do you like the movies you've selected?

       <p><textarea NAME="describe" ROWS="5" COLS="35"></textarea><br>

       <p><input TYPE="SUBMIT" VALUE="Submit Form"><input TYPE="RESET" VALUE="Reset Form">
       </form>


<%  } else {%>

      <%   if(Request.form("name") == "") {%>
          <p>You did not provide your name.
      <%  } else {%>
          <p>Your name is <b><%= Request("NAME") %></b>
           <%  } %>
           
      <%   if(Request("Movies") == "") {%>      
           <p>You did not select any movies.
      <%} else{ %>
           <p>The movies you like are: <b><%= Request("Movies") %></b>
           <%  } %>

      <%   if(Request.form("describe") == "") {%>
           <p>You did not say why you like the movie(s) you have selected.
      <%} else {%>
  
           <p>Your description of why you like the movie(s) is:
           <b><i><%= Request.form("describe") %></b></i>
      <%   } %>
<%  } %>
           
<br>
<br>
</body>
</html>


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.