title: Get selected value from HTML - <select>--</select> box
body: <p>I am dealing with a web application. I have a HTML - <strong>select</strong> box with 50k string values. From these 50k values user will select one and I want to use that selected value in a SQL where clause for further retrieval. But right now with existing code I am getting null. Code looks like - </p>
  
  <pre><code>out.println("&lt;form action=sampleServlet method=POST&gt;");
          out.println("&lt;select name=\"data\"&gt;");
          for(int i=0;i&lt;nw.collectdata.length;i++)
          {
              out.println("&lt;option value='"+nw.collectdata[i]+"'&gt;"+nw.collectdata[i]+"&lt;/option&gt;");
          }
          out.println("&lt;/select&gt;");
          out.println("&lt;button type='submit'&gt;Submit&lt;/button&gt;");
          out.println("&lt;/form&gt;");
          elements = request.getParameter("data");
          out.println(elements);
  </code></pre>
  
  <p><strong>elements</strong> is returning null and not selected value.</p>