title: how to get selected options value in php/javascript?
body: <p>I want to get html slected option value in php or javascript.</p>
  <p>I am trying to do is:</p>
  <pre><code>&lt;form action=&quot;book-page-1.php&gt;&quot; method=&quot;POST&quot;&gt;
    &lt;select name=&quot;chosePage&quot;&gt;
       &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;
       &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
       &lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
       &lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;
       &lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;
    &lt;/select&gt;
  
      &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Update&quot;&gt;    
  &lt;/form&gt;
  </code></pre>
  <p>What I want is to pass the selected page number in <strong>&quot;form action&quot;</strong> before submitting the form like:</p>
  <pre><code>// I want to pass selected option value in &quot;url&quot; before submit the form
  &lt;form action=&quot;book-page-&lt;?php echo selected option;?&gt;.php&gt;&quot; method=&quot;POST&quot;&gt;
  </code></pre>
  <p>I dont want in php post like:</p>
  <pre><code>  // This is not my requirement - Because I want to pass value in &quot;url&quot; before submit the form
   if (isset($_POST['chosePage'])) {
       $op = $_POST['searchItemname'];
   }
  </code></pre>
  <p>I want to pass the selected option value in url.
  PHP or JAVASCRIPT all are welcome.</p>
  <p>Any Idea would be welcome.
  Thanks</p>