㈠ 求助!!HTML源代码!要求可以实现在线答题,且为多项选择题的源码!
你说的多项选择题,我是不是可以理解成多选??
多选的实现是这样的:回
第一答: 必须将多选框放到form里面。
第二: 然后name属性完全一样,value不相同。这样当你提交到Action中的时候,只需要使用request对象获取toselect的值就行了。
第三: 获取值:request.getParameterValues("toselect"),就会将选中的多选框里面的value获取,并且返回一个String[]数组,这个数组里面就有你想要的值:即选中的值
<html>
<body>
<form>
<input type = "checkbox" value = "A" name = "toselect"/>A
<input type = "checkbox" value = "B" name = "toselect"/>B
<input type = "checkbox" value = "C" name = "toselect"/>C
<input type = "checkbox" value = "D" name = "toselect"/>D
</form>
</body>
</html>