please dont rip this site


The Form collection retrieves the values of form elements posted to the HTTP request body by a form using the POST method.





Specifies the name of the form element from which the collection is to retrieve values.


An optional parameter that enables you to access one of multiple values for a parameter. It can be any integer in the range 1 to Request.Form(parameter).Count.


Post data (make the form action=) to to see the form variables and data. or use to see everything.

The Form collection is indexed by the names of the parameters in the request body. The value of Request.Form(parameter) is an array of all of the values of parameter that occur in the request body. You can determine the number of values of a parameter by calling Request.Form(parameter).Count. If a parameter does not have multiple values associated with it, the count is 1. If the parameter is not bound, the count is 0.

To reference a single value of a form element that has multiple values, you must specify a value for index. The index parameter may be any number between 1 and Request.Form(parameter).Count. If you reference one of multiple form parameters without specifying a value for index, the data is returned as a comma-delimited string.

When you use parameters with Request.Form, the Web server parses the HTTP request body and returns the specified data. If your application requires unparsed data from the form, you can access it by calling Request.Form without any parameters.

You can use an iterator to loop through all the data values in a form request. For example, if a user filled out a form by specifying two values, Chocolate and Butterscotch, for the FavoriteFlavor parameter, you could retrieve those values by using the following script.

  For Each item In Request.Form("FavoriteFlavor")
    Response.Write item & "<BR>"

The preceding script would display the following.


The same output can be generated with a For…Next loop, as shown in the following script.

  For I = 1 To Request.Form("FavoriteFlavor").Count
    Response.Write Request.Form("FavoriteFlavor")(I) & "<BR>"

You can use this iterator to display the parameter name, as shown in the following script.

<% For Each x In Request.Form %>
Request.Form( <%= x %> ) = <%= Request.Form(x) %> <BR>
<% Next %>

Which displays:

FavoriteFlavor = Chocolate
FavoriteFlavor = Butterscotch


Consider the following form.

<FORM ACTION = "/scripts/submit.asp" METHOD = "post">
<P>Your first name: <INPUT NAME = "firstname" SIZE = 48>
<P>What is your favorite ice cream flavor: <SELECT NAME = "flavor">
<OPTION>Strawberry <OPTION>Chocolate <OPTION>Rocky Road</SELECT>

From that form, the following request body might be sent.


The following script can then be used.

Welcome,  <%= Request.Form("firstname") %>. 
Your favorite flavor is <%= Request.Form("flavor") %>.

The following output is the result.

Welcome, James. Your favorite flavor is Rocky Road.

If the following script is used:

The unparsed form data is:  <%= Request.Form %> 

The output would be:

The unparsed form data is:  firstname=James&flavor=Rocky+Road

Applies To

Request Object

See Also

ClientCertificate, Cookies, QueryString, ServerVariables

© Microsoft Corporation. All rights reserved.

file: /Techref/language/asp/obj/introbj_9.htm, 6KB, , updated: 2006/4/28 15:56, local time: 2024/5/27 15:43,

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> Form</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2024 contributors:
o List host: MIT, Site host, Top posters @none found
- Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!