title: assign value of a js variable to a php variable and then use in html form field
body: <p>In a HTML form a date is selected in field with name <code>manufacture_one</code></p>
  <p>When the button is clicked the js function <code>showEndDate()</code> is triggered.  The value entered in field with id  <code>myTextInputID</code> is assigned to js variable.  I have tested that the date entered in the form is displayed in an alert box.</p>
  <p>I am trying to assign this variable to php variable and use it as an upper limit in the field with name <code>end_date</code></p>
  <pre><code>      &lt;div&gt;
        &lt;div id=&quot;standardPanel&quot;&gt;*Task / Person: &lt;input type=&quot;text&quot; name=&quot;product&quot; required &gt;&lt;/div&gt;
        &lt;div id=&quot;standardPanel&quot;&gt;*Description: &lt;input type=&quot;text&quot; name=&quot;customer&quot; required &gt;&lt;/div&gt;
        &lt;div id=&quot;standardPanel&quot;&gt;*Date: &lt;input id=&quot;myTextInputID&quot; type=&quot;date&quot; name=&quot;manufacture_one&quot; required &gt;&lt;/div&gt;
        &lt;p class=&quot;flip&quot; onclick=&quot;showEndDate()&quot;&gt;Click to add End Date&lt;/p&gt;
        &lt;div id=&quot;panel&quot;&gt;
          End Date: (holidays only) &lt;input type=&quot;date&quot; name=&quot;end_date&quot; max='&lt;?php echo $endDate; ?&gt;'&gt;
        &lt;/div&gt;
        &lt;div&gt;&lt;input id=&quot;submit&quot; name=&quot;action&quot; type=&quot;submit&quot; value=&quot;submit&quot;/&gt;&lt;/div&gt;
      &lt;/form&gt;
  
      &lt;script&gt;
      function showEndDate() {
        document.getElementById(&quot;panel&quot;).style.display = &quot;block&quot;;
        var inputValue = document.getElementById(&quot;myTextInputID&quot;).value;
        alert(inputValue);
        &lt;?php $endDate = &quot;&lt;script&gt;document.write(inputValue)&lt;/script&gt;&quot;?&gt; 
      }
      &lt;/script&gt;
  </code></pre>