首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

批量checkbox提交有关问题

2012-10-08 
批量checkbox提交问题form methodpost actionresult.jsp target_blankinput typecheckbox na

批量checkbox提交问题

<form method="post" action="result.jsp" target="_blank">

<input type=checkbox name=interest value="篮球">

? ? ? ? 篮球<p>

<input type=checkbox name=interest value=" 游泳">

? ? ? ? 游泳<p>

<input type=checkbox name=interest value="读书">

? ? ? ? 读书<p>

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

</form>

上面这些checkbox的name是一样的,我们可以一样提交他们。在接收端之需要:

String s[] = request.getParameterValues("interest");

for (int i = 0; i < s.length; i++)

{

out.print(s[i] + "<br>");

}

这样接收就可以了。

热点排行