若有重复的表格name,则值为哪个?

zairwolfc 2004-08-04 03:28:29
<input type=text name=a>
<input type=submit name=a value=x>

这样的值将会是哪个?不会提示错误的吧?
...全文
109 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
zairwolfc 2004-08-04
  • 打赏
  • 举报
回复
是吧,并不是后一个,而是当前激活的那个。
stefli 2004-08-04
  • 打赏
  • 举报
回复
经过简单的测试,测试代码如下:
test.asp
--------------------------------------------------------------------------------
<html>
<%
Response.Write Request("stefli")
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>

<body>
<form name="form1" method="post" action="test.asp">
<input name="stefli" type="text" id="stefli" name="stefli">
<input name="stefli" type="text" id="stefli" name="stefli">
<input name="stefli" type="submit" id="stefli" name="stefli" value="提交">
<input name="stefli" type="submit" id="stefli" name="stefli" value="删除">
</form>
</body>

</html>

测试内容:
[1]第一个框为1,第二个框为2,点击第一个按钮"提交"
[2]第一个框为1,第二个框为2,点击第二个按钮"删除"

测试结果:
[1]的结果是"1, 2, 提交"
[2]的结果是"1, 2, 删除"
zairwolfc 2004-08-04
  • 打赏
  • 举报
回复
好像并不一样。我在我的程序里面发现,是不同的。
zairwolfc 2004-08-04
  • 打赏
  • 举报
回复
我知道。但我要提交得到的action值。也是一样的么?
josney 2004-08-04
  • 打赏
  • 举报
回复
两个是一样的,会执行同样的操作
zairwolfc 2004-08-04
  • 打赏
  • 举报
回复
<form ……>
……
<input type=hidden name='action' value='del'>
<input type=submit name=action value=合并>
<input type=submit name=delete value=删除>
</form>

有如上内容。如果我点击删除按钮,那action值为何?
zairwolfc 2004-08-04
  • 打赏
  • 举报
回复
那如果我没有用那个submit,而是用另外一个submit提交的话,改submit的值还会有效么?
AlexJia2046 2004-08-04
  • 打赏
  • 举报
回复
最后一个
<input type=text name=a>
<input type=submit name=a value=x>
xuzuning 2004-08-04
  • 打赏
  • 举报
回复
后一个
zairwolfc 2004-08-04
  • 打赏
  • 举报
回复
如果submit那行在前面呢?
xuzuning 2004-08-04
  • 打赏
  • 举报
回复
后一个

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧