如何从form表单中得取checkbox的值?

参考答案

页面:

<form ...>
  <input type="checkbox" name="hobby" value="唱歌"/>
  <input type="checkbox" name="hobby" value="跳舞"/>
  <input type="checkbox" name="hobby" value="电影"/>
</form>

servlet:

String[] hobby = request.getParameterValues("hobby");

results matching ""

    No results matching ""