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

ASP
绑定txt文件到DataGrid
在用户离开页面时提示信息
asp + oracle 分页方法(不用存储过程)
asp + sqlserver 分页方法(不用存储过程)
验证身份证号是否正确的代码
检查有日文片假名的新闻
asp关键字函数运算附
ASP中也能解压缩rar文件
ASP文章系统解决方案
DW+ASP 玩转动态二级菜单
在ASP中操作数据库的方法
ASP做象资源管理器的树形目录
在asp中结合对象和组件
Active Server Pages是什么?
ActiveServerPages是怎样工作?
ASP脚本基础
ASP中的内建对象Server
在网页中动态的生成一个gif图片
ASP.NET中的状态管理
解决ASP执行DB查询中的特殊字符问题

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 45 ::
收藏到网摘: 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>