How do I get the names of all the forms in ASP the corresponding value . In fact, the problem is very simple, but there may still be a lot of people do not know how to do, so specially written down for reference only. In an ASP program, the object used to obtain client data is Request, which provides us with a number of methods and attributes. 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
%>