title: HTML button event and selected checkboxes
body: <p>I am using the following code to handle html button event:</p>
  
  <pre><code>if(request.getParameter("btnSubmit")!=null)
  </code></pre>
  
  <p>And I am using the following codes to capture selected checkboxes that have all same name("choices") : </p>
  
  <pre><code>String[] selecttype = request.getParameterValues("choices");
  
  if (selecttype != null &amp;&amp; selecttype.length != 0) 
  {
      for (int i = 0; i &lt; selecttype.length; i++) 
      { 
      out.println("&lt;h4&gt;&lt;font color = 'red'&gt;" + selecttype[i] + "&lt;/font&gt;&lt;/h4&gt;");
        }
  }
  </code></pre>
  
  <p>the problem is, before pressing the button submit, values of selected checkboxes are showed to the screen. However, when the button submit is pressed these values disappeared. Any help please?!</p>