title: Will I get the display: none input value in servlet
body: <p>I have read somewhere in stackoverflow that we will not get the value of checkbox which is display:none using javascript but I am getting the value of checkbox in servlet.</p>
  
  <p><Strong>Below is my JSP code</Strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function hideData(){
   document.getElementById("checkBoxTest").style.display="none";
  
  }
  &lt;/script&gt;
  
  &lt;form action="DisplayServlet" method="get" &gt;
  
  &lt;input type="checkbox" value="CheckboxTest" id ="checkBoxTest" name = "checkBoxTest" checked/&gt;Test &lt;br/&gt;
  &lt;a href="#" onclick = "return hideData();"&gt;Click to hide check box &lt;/a&gt; &lt;br/&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But I am getting values of checkbox even if I hide it. But somewhere in stackoverflow I read that visibility:hidden will give value whereas display:none will null values.</p>
  
  <p>My servlet code where I am getting values.</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      String checkBoxValue = request.getParameter("checkBoxTest");
      System.out.println("checkBoxValue ====== "+checkBoxValue);
  }
  </code></pre>