<%@ language = vbscript%>
<% Response.Expires = 0 %>
<html>
<head>
<title>星河影动之动态添加Form项</title>
</head>
<body>
<%
If Request("Action") = "提交列表" Then
Response.Write "<B>提交的项:</B><BR>"

' 显示输入的内容.
nItems = Request.Form("Items").Count
For i = 1 To nItems
Response.Write Request.Form("Items")(i) & "<BR>"

' 显示提交的项.
Next
Response.Write Request("Item") & "<BR>"
Else
' 为所有的项创建Form.

 %>
<FORM Action=dynaform.asp Method=Post>
<B>项:</B><BR>
<%
nItems = Request.Form("Items").Count
For i = 1 To nItems
Response.Write "<INPUT Type=Text Name=Items Value=""" & _
Trim(Request.Form("Items")(i)) & """><BR>"

' 显示前面已提交的项.
Next

If Request.Form("Item") <> "" Then
Response.Write "<INPUT Type=Text Name=Items Value=""" & _
Trim(Request.Form("Item")) & """><BR>"

' 保存已输入的项,再生成一个新的输入框.

Response.Write "<P>请输入项,并点击"添加项到列表"按钮提交<BR>"
Response.Write "<INPUT Type=Text Size=50 Name=Item Value="""""">"
Else
Response.Write "<P>请输入项,并点击"添加项到列表"按钮提交Please enter an Item,<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>

 

[1]

标签:
|如何|何动|动态|态添|添加|加F|Fo|or|rm|m项|项?|?|

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com

评论“如何动态添加Form项?”

暂无“如何动态添加Form项?”评论...