急!追加30分。有关asp获取表单的问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 12:41:43
我在一个页面放置了几个(>1)表单,这几个表单的action都为同一个页面,比如example.asp,那么在点击提交按钮后example.asp有没有办法区分到底是前一个页面的哪个表单提交上来的数据?method可以使get,也可以是post都没关系。
能否请各位讲的详细点,我不太明白。比如hiteve说的方法,要怎么检查identify的值呢?拜托了。谢谢!

第一种方法,在action中加上一个区分变量。
example.asp?identity=a example.asp?identity=b.....

第二种方法就是如hiteve所说的,用隐藏控件了。。。

在你的exeample.asp中加上这样一个判断:
identity=request("identity") '第二种方法请写成identity=request.form("identity")
if identity="a" then
写上A表的操作。。。
else if identity="b" then
B表的操作。。。
else if ....这里省略。。。

end if

在A表单中加入
<input type="hidden" name="identity" value="A">
在B表单中加入
<input type="hidden" name="identity" value="B">
在C表单中加入
<input type="hidden" name="identity" value="C">
等隐藏的控件(不会在web上显示)。

每次提交后都检查identity控件的值,就知道是哪个表单了

form name你改变一下就可以了