File:dynaform. Asp
<%@ language = vbscript%>
<% Response.Expires = 0%>
<HTML>
<HEAD>
<title>dynamically Growing form</title>
</HEAD>
<BODY>
<%
If Request ("Action") = "Submit The List" Then
' Show what was entered.
Response.Write "<b>here are the Items submitted:</b><br>"
Nitems = Request.Form ("Items"). Count
For I = 1 to Nitems
' Show submitted Items
Response.Write Request.Form ("Items") (I) & "<BR>"
Next
Response.Write Request ("Item") & "<BR>"
Else
' Create ' form from all items. %>
<form action=dynaform.asp method=post>
<B>Items:</B><BR>
<%
Nitems = Request.Form ("Items"). Count
For I = 1 to Nitems
' Show previously submitted Items
Response.Write "<input type=text name=items value=" "& _
Trim (Request.Form ("Items") (I)) & "" ><BR> "
Next
If Request.Form ("Item") <> "Then
' Paint a new input box, and store the old Item in Items collection
Response.Write "<input type=text name=items value=" "& _
Trim (Request.Form ("Item")) & "><BR>"
Response.Write "<p>please Enter an item,<br>"
Response.Write "and submit them one at a time<br>"
Response.Write "by pressing the ADD Item button.<br>"
Response.Write "<input type=text size=50 name=item value=" "" "" > "
Else
' No Item was submitted and don ' t show an error
Response.Write "<p>please Enter an item,<br>"
Response.Write "and submit them one at a time<br>"
Response.Write "by pressing the ADD Item button.<br>"
Response.Write "<input type=text size=40 name=item value=" "" "" ">
<BR> "
End If
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.