am new to this so can you all try to help me please. 

In my java class,

```
public String mycheckbox;
// setters and getters for mycheckbox

```

In my form,

```
<input id="f2_chk_1" type="checkbox" value="1" name="f2_chk_1">
1
<br>
<input id="f2_chk_2" type="checkbox" value="2" name="f2_chk_2">
2
<br>
<input id="f2_chk_3" type="checkbox" value="3" name="f2_chk_3">
3
<br>
<input id="f2_chk_4" type="checkbox" value="4" name="f2_chk_4">
4
<br>
<input id="f2_chk_5" type="checkbox" value="5" name="f2_chk_5">
5
<br>
<input id="f2_chk_6" type="checkbox" value="6" name="f2_chk_6">
MT
<br>
<input id="f2_chk_7" type="checkbox" value="7" name="f2_chk_7">
6

```

What i want is when i check a checkbox, mycheckbox should automatically get the value; even multiple checkboxes are checked.

I googled it but came up with examples where the checkboxes are defined in the java class itself and things which are not meaningful to me.