网站源码下载PR查询短网址
首页编程数据库网页图形冲浪邮件下载浏览器QQ系统办公软件站长安全手机邮件认证组网通信


网站首页 -> 网络编程 -> ASP技巧
如何使用ASP制作模似动态生长的表单?

发表日期:2000-11-3



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>


上一篇:ADO如何新增修改刪除数据库的资料呢? 人气:13529
下一篇:如何善用Response.Buffer增进浏览速度? 人气:18176
网站文章搜索
邮件订阅服务
输入你的邮件地址,你将不会错过任何关于<ASP技巧教程>的内容
今日更新文章
·教你一种新思路调色教程
·使用Lab颜色通道调出照片完美色彩
·PS打造柔美风格色调教程
·教你给宝宝皮肤美白教程
·利用风景图片制作特色明信片
·PS给照片制作蓝天背景
·Photoshop制作沧桑颓废的城市海报
·如何才能出现”添加至百度首页“标志
·没学历 没文凭 没背景 我选择了SEO
·不可小觑的论坛式外链
·SEO的价值并不仅仅体现在搜索引擎上
·Photoshop打造完美江景
本栏目推荐文章
·关于.net生成静态页面的方法总结
·一个分页存储过程
·用C++制作有HTML风格的动态按钮
·脚本引擎之----读取INI配置文件
·函数式组合子逻辑Java parser框架(一)
·Java的中文编程与配置心得
·Ajax简单客户登陆验证
·新产品开发项目中的需求问题
·关于Delphi大Bug的更详细的例子
·asp下闰年计算方法
·aspjpeg组件高级使用方法介绍
·J2EE疑难解决实例
Copyright © 2005-2012 www.Devdao.com All rights reserved | 沪ICP备05001343号 sitemap