My JSP web page has many checkboxes.
What is web page source code look like when clicking one checkbox will submit only one checkbox value (not the whole form) immediately?
i.e. toggling one checkbox will send the info that only that checkbox is toggled.
This does not work because clicking one checkbox will send the whole page
<form name="myform" method="post">
<input type="checkbox" name="choice" value="1" onclick="submit();">
<input type="checkbox" name="choice" value="2" onclick="submit();">
<input type="checkbox" name="choice" value="3" onclick="submit();">
If each checkbox is a separate form then give each their own separate form tag.
Is it possible to have only one form?
It is possible to have only one form if you want to submit to only one page.
The better alternative is to make the server-side smarter, so that it directs the form submission where it needs to go, or to use multiple forms on the page.
The danger of submitting when a checkbox is clicked is that it conflicts with how people know web forms work on the 1000+ other web forms they have recently used.