欢迎光临
我们一直在努力

ASP中一个页面多个表单的提交-ASP教程,ASP应用

建站超值云服务器,限时71元/月

做网页有时我们需要将多个表单方在同一个页面

处理表单的程序页怎样才知道那个表单被提交了并作相应的处理呢?

下面是一个例子:

form.asp

<%@language="vbscript" codepage="936"%>

<script language="vbscript" runat="server">

sub chuli()

if request.querystring("formid")=1 then

response.write(request.form("textfield"))

elseif request.querystring("formid")=2 then

response.write(request.form("textfield2"))

end if

end sub

</script>

<html><head><title>一个页面多个表单的提交</title></head>

<body>

<table width="300" border="0" cellspacing="0" cellpadding="0" align="center">

<tr>

<td><form name="form1" method="post" action="form.asp?formid=1">

<input type="text" name="textfield">

<input type="submit" name="submit" value="提交">

</form></td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td><form name="form2" method="post" action="form1.asp?formid=2">

<input type="text" name="textfield2">

<input type="submit" name="submit2" value="提交">

</form></td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td>

<%

chuli 调用服务器端过程

%>

</td>

</tr>

</table>

</body>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ASP中一个页面多个表单的提交-ASP教程,ASP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章