title: how to set value in Option onchange selection in Jsp
body: <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form method="post" action="index.jsp" name="productForm"&gt;
  
          &lt;/select&gt; &lt;select name="colour" onchange="document.productForm.submit()"&gt;
              &lt;option value="black"&gt;Black&lt;/option&gt;
              &lt;option value="white"&gt;White&lt;/option&gt;
              &lt;option value="brown"&gt;Brown&lt;/option&gt;
          &lt;/select&gt;
      &lt;form&gt;
  
          &lt;%
              String colour = request.getParameter("colour");
              out.println(colour);
          %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This My Source code of index.jsp when i select change then it pass value to console and Print it But onSelect drop down Value is not set it set to first value please help me how to set value in Obation also </p>