Code for retrieving all the content of a form in an ASP program

Source: Internet
Author: User

in ASP, How can I obtain the names and values of all forms. In fact, this problem is very simple, but many people may not know how to do it, so write it down specially for reference only. In ASP Program , the object used to obtain client data is request. This object provides us with many methods and attributes. For example, there is such a form,







If we want to obtain the value in username, we can write: request. form ("username")

This is a collection, that is to say, all the content in the form is stored in this set

To obtain the value of an element, you only need to specify the element name in request. Form (), for example,

the username above.

what if we want to obtain all the values in the set? That's very simple. You don't need to keep up with anything. Simply write request. Form

to get the names and values of all elements in the set. The following is a statement for Set Operations:

<%
for each OBJ in request. form
response. write OBJ & "& request. form (OBJ) & "
"
next
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.