title: Trigger JQuery UI Datepicker from Function and store date into a var
body: <p>I need your help.</p>
  
  <p>Is it programmatically possible to use the Jquery picker, ie. trigger the datepicker by calling a function and then store the selected date into a var as opposed to a hidden input box?</p>
  
  <p>Any help with this would be greatly appreciated.</p>
  
  <p>The current example that I have triggers the date picker from a function but uses a hidden input box.</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  
  &lt;!-- LOAD JQUERY LIBRARY: --&gt;  
      &lt;link   href="jq/jquery-ui.css"         type="text/css" rel="stylesheet" /&gt;
      &lt;script src="jq/jquery.min.js"          type="text/javascript"&gt; &lt;/script&gt;
      &lt;script src="jq/jquery-ui.min.js"       type="text/javascript"&gt; &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function test() {
  
  $("#d1").datepicker().datepicker("show");
  
  
  
  
  }
  
  &lt;/script&gt;
  
  
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;input style="display: none" type="text" id="d1"&gt;
  
  &lt;a href="javascript:test()"&gt;test&lt;/a&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>Cheers,</p>
  
  <p>Jay</p>