这样的表单如何做?通过URL传递参数

vagrant_zy 2007-11-09 08:12:35
表单上选择几种东西,比如name,time等

然后选择的东西通过URL传递

比如说我的目标是abc.htm,表单提交后,URL上地址就是abc.htm?name=xxx&time=2007-07-07 这样的

...全文
209 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hejunbin 2007-11-12
  • 打赏
  • 举报
回复
只要有Name属性就可以显示在提交上面的,不要显示就去掉name属性。
hejunbin 2007-11-12
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

</head>
<body>
<form id="form1" name="form1" method="get" action="">
<label>
<input type="checkbox" id="name" value="hua2r" onclick="this.name=this.id;" />
name<br />
</label>
<label></label>
<label>
<input type="checkbox" id="time" value="now" onclick="this.name=this.id;;" />
</label>
<label> time<br />
<input type="checkbox" id="foobar" value="foobar" onclick="this.name=this.id;" />
foobar<br />
</label>
<label>
<input type="submit" id="button" value="提交" />
</label>
</form>
</body>
</html>

可能楼主要的是这样的效果
fxs_2008 2007-11-11
  • 打赏
  • 举报
回复
楼上各位正解!
nicholsky 2007-11-11
  • 打赏
  • 举报
回复
上面说的正解。get方式是URL传递,post方式是隐藏传递,但get传递有限制,超过256(印象中)字符后的就传递不了,post方式对传递字节无限制。
gnimgnot 2007-11-10
  • 打赏
  • 举报
回复
同上
shineran 2007-11-10
  • 打赏
  • 举报
回复
1楼说得没错。

<form id="form1" action="abc.htm" method="get">
<input type="text" name="name" value="ttt" />
<input type="text" name="time" value="2007-11-10" />
<input type="submit" value="提交" />
</form>
huzy204 2007-11-09
  • 打赏
  • 举报
回复
form 里面指定 method = get不就完了?

61,110

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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