title: Update hidden input element with weekday value from jQuery Datepicker plugin
body: <p>I’m just not familiar enough with jQuery to get this working. Using the jQuery Datepicker plugin, and with already some help, I have it working except for also updating the hidden input element with the selected week day value. Everything I’ve tried interferes with the function of the Datepicker plugin. Any help would be welcomed. </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;script src="../js/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;title&gt; jquery date picker &lt;/title&gt;
  
  &lt;script type="text/javascript"&gt;
  $(function () {
    $("#Datepicker").datepicker();
  });
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  function pickdate() {
      var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ];
      var selecteddate = $("#Datepicker").datepicker('getDate');
      $('#Datepickerday').html(days[selecteddate.getDay()]);
  
      // also needs to update hidden input 'weekday' with day of week
  
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  Date:&amp;nbsp;&amp;nbsp;&lt;input type="text" name="Datepicker" id="Datepicker" class="Datepicker" onchange="pickdate();"&gt;
  &lt;br&gt;&lt;br&gt;
  Day:&amp;nbsp;&lt;span id="Datepickerday"&gt;&lt;/span&gt;
  
  &lt;input type="hidden" name="weekday" id="weekday"&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>