ASP Request.Form Collection
The Request.Form Collection in ASP is used for returning the collection of form elements that posted to the HTTP request body, with a form using the POST method.
Request.Form( element )[(index)|.Count]
- Element: It specifies the name of the form elements. It is a required attribute.
- Index: It is an optional parameter that represents a position of form elements that used to access. It can be any integer from 1 to n.
Example 1: Below code uses the for loop to access the form values filled by the user. We could retrieve those values like this:
Following Values filled by the user:
Here is the ASP code that is used to retrieve the information from the form.
Hi, Naman. Your favorite game is Cricket