getParameter returning null even though checkbox is checked!
843836Sep 2 2003 — edited Sep 2 2003I did search for help in other threads, but my problem is still unresolved. My JSP has a form, and when it's submitted, some JSP code at the top of the page handles it with this:
if(request.getMethod().equalsIgnoreCase("POST")) {
etc, etc.
Most of the form fields are being extracted on the back end in a bean, but now I need to add a checkbox to see which bean to use, so I'm trying to do it in the JSP right after the code above:
if(request.getMethod().equalsIgnoreCase("POST")) {
String saveAddrString = request.getParameter("saveaddresses");
out.println("saveaddresses is " + saveAddrString);
etc, etc.
The checkbox HTML code looks like this:
<td>Check this box to save them: <input type='checkbox' name='saveaddresses' value='yes'></td>
The println statement above says that saveAddrString is null even when I check the box! How could this be?