当前位置: 首页 > 图文教程 > 网络编程 > ASP > 如何使用ASP制作模似动态生长的表单?

ASP
在线人数统计内幕
介绍一个制作下拉菜单完全不同的办法
server push具体实现(转)
如何完整纪录站内所有网页点选次数(转)
使用ASP常见问题解答(转载)
处理Asp中的错误
微软修补其IIS软件中的又一处安全漏洞
细细品味ASP.NET (一)
细细品味ASP.NET (二)
细细品味ASP.NET (三)
ASP+与JSP之间的抉择
细细品味ASP.NET (四)
细细品味ASP.NET (五)
用asp.net和xml做的新闻更新系统(1)
用asp.net和xml做的新闻更新系统(2)
用asp.net和xml做的新闻更新系统(3)
用ASP+XML打造留言本(1)
用ASP+XML打造留言本(2)
用ASP+XML打造留言本(3)
用ASP+XML打造留言本(4)

如何使用ASP制作模似动态生长的表单?


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 30 ::
收藏到网摘: n/a

       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 the 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, 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
  
  %>
  
  <P>
  <INPUT Type="Submit" Name="Action" Value="Add Item to List">
  <INPUT Type="Submit" Name="Action" Value="Submit the List">
  <BR>
  
  <% End If %>
  
  </FORM>
  </BODY>
  </HTML>