title: Bootstrap datepicker: Focus without opening
body: <p>I'm using a bootstrap datepicker and jQuery validate.  I have jquery validate set to focus on the input when the field is empty &amp; required.</p>
  
  <p>With bootstrap datepicker however, the focus event causes the calendar to open.  Which is not ideal in my situation.  I'm wondering if there is a way to focus, but pass through a preventDefault or something like that?</p>
  
  <p>I made a jsfiddle.  Basically, is it possible to click the button to focus on the element, but not have the calendar open? <a href="https://jsfiddle.net/a2gkpxuh/" rel="nofollow noreferrer">https://jsfiddle.net/a2gkpxuh/</a> The primary purpose of the focus is to scroll the page so the user can see the required element.</p>
  
  <pre><code>$("#myButton").click(function () {
     //Some code to prevent default here?  Possibly disable datepicker before .focus event
     $("#myDatePicker").focus();
  });
  </code></pre>
  
  <p>I guess one possible solution would be to disable the datepicker, then do my jQuery.validate(), then re-enable the datepicker.  I feel like there's a better way though...</p>
  
  <p>FYI Here is a similar question: <a href="https://stackoverflow.com/questions/33239135/set-focus-on-jquery-datepicker-on-datepicker-close-without-opening-datepicker">Set focus on Jquery datepicker on datepicker close, without opening datepicker</a></p>