Program
/**
@ Description: The way to get all the contents of a form in an ASP program
@ Author: Ci Qin Qiang
@Email: cqq1978@Gmail.com Http://blog.csdn.net/cqq
*/
Just now in the forum to see someone ask this question, is in the ASP how to get all the forms of the name and
The corresponding value. In fact, the problem is very simple, but there may still be a lot of people do not know what to do, so specifically
Write it down for reference only.
In an ASP program, the object used to obtain client data is Request, which provides us with a lot of
Methods and properties. For example, there is a form,
<form method=post name=cqq action= "" >
<input type= "text" name= "username" >
<input type= "text" name= "password" >
<input type= "checkbox" name= "Sex" value= "male" >
<input type= "checkbox" name= "Sex" value= "female" >
<input type= "Submit" >
</FORM>
If we want to get the value in username, we can write this: Request.Form ("username")
This is everyone, in fact, this form is a collection, which means that all the content in the form is stored in this collection
In which we have to get the value of an element, we just need to set the name of the element here in Request.Form (), such as
Above the username.
So, what do we need to get all the values in the collection? That's simple, nothing to do with it, just write Request.Form.
Gets the name and value of all the elements in the collection. The following is a statement that operates on a collection:
<%
For each obj in Request.Form
Response.Write obj & "" & Request.Form (obj) & "<br>"
Next
%>