I\'m developing a jsp/serlvet application. I have a page with a list of inputs as checkboxes . I want to send values of selected buttons to a servlet using ajax/jquery. In the s
They are sent using their name, repeated:
servlet?do=deleteSelected&checkboxGroup=value1&checkboxGroup=value2
You can see that with the following simple html (after you press the submit button, take a look at the address bar):
<form method="get">
<input type="checkbox" name="checkboxGroup" value="1" />
<input type="checkbox" name="checkboxGroup" value="2" />
<input type="checkbox" name="checkboxGroup" value="3" />
<input type="submit" />
</form>
You obtain them using:
String[] values = request.getParameterValues("checkboxGroup");