title: Get the value of a hidden input in server side Php which was set by javascript
body: <p>This wordpress stuff driving me mad again.</p>
  
  <p>I have an output page which uses a short code to call a function (Stores)... the code of which in part is beneath.
  It has a dropdown and a table of data, ..the data being dependant on the selected option of the drop down.</p>
  
  <p>I use javascript to set the hidden input...successfully.
  In fact I tried a normal, non hidden input as well...same result,..on server side, with$_POST["txtSelection"] or 
  $_POST["hdnSelect"]</p>
  
  <p>But when I try get it's value on the php server side code, it is empty,..
  How on earth do I retrieve it? </p>
  
  <p>the hidden input is inside the form tag.</p>
  
  <pre><code>&lt;?php
  function Stores()
  {
     global $wpdb;
     global $MyPage;
     $MyPage =  str_replace( '%7E', '~', $_SERVER['REQUEST_URI']);
  ?&gt;
  &lt;form name="frmSB_stores" method="post" action="&lt;?php echo $MyPage ?&gt;"&gt;  
  &lt;input type="hidden" name="hdnSelect" id="hdnSelect" value=""&gt;
  &lt;input type="text" name="txtSelection" size="19"  id="txtSelection" value=""&gt;
  &lt;script type="text/javascript"&gt;
    function SetDDLValueOnChange (objDropDown) {
  var objHidden = document.getElementById("hdnSelect");
  if ( objDropDown.value.length &gt; '0')
  {
      objHidden.value = objDropDown.value; //.substr(0,1);
      //alert(" hdn = " + objHidden.value);
      window.location = '&lt;?=$MyPage;?&gt;' ;
  }
  
  }  
  &lt;/script&gt;
  </code></pre>
  
  <p>the dropdown's markup here,..then</p>
  
  <pre><code>&lt;table width='100%' border='0' cellspacing='5' cellpadding='3'&gt;
   &lt;?php
  $Area = $_POST['txtSelection']; //or $_POST['hdnSelect']
  </code></pre>
  
  <p>which has zilch in it , even though it is set successfully by jvascript</p>
  
  <p>Why is this such an issue in WordPress, 
  How do i overcome it.
  It's nuts spending a full day on something which should be so trivial (works fine in a normal php situation, os asp or asp.net,..but not in WP.)!
  TIA
  N</p>