I am trying to get the value of a checkbox from a posted form data. I already have the form working because I can get the value of a file easily enough(I have omitted the file form field in the code below), but the checkbox wont return anything other than null. What am I doing wrong?
Servlet:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String str = request.getParameter("isTransform"); System.out.println("parameter: " + str); } Html Client:
<form enctype="multipart/form-data" id="compareForm1" > <input type="checkbox" value="true" name="isTransform" id="isTransform1" > </form> I have jquery.form.js sending the actual post
var options = { url: "http://localhost:8080/TestingTomcat/someClassName", type: "POST", success: function (html){ $("#placeholder").html(html); change_active("comparison_page"); } }; $("#compareForm1").submit(function () { $(this).ajaxSubmit(options); return false; }); Actual Post data:
POSTDATA =-----------------------------153501500631101 Content-Disposition: form-data; name="isTransform" true -----------------------------153501500631101 Content-Disposition: form-data; name="isTransform" true -----------------------------153501500631101-- And the result I get with the button clicked or unclicked is:
parameter: null