title: Validating bootstrap datepicker from bootstrap formhelpers
body: <p>Is it possible to use the JQuery Validation to validate the Bootstrap Datepicker? As it doesn't expose the <code>input</code> field, I can't get it to validate.</p>
  
  <p>Example: <a href="https://jsfiddle.net/Khrys/2rcr9j5s/">https://jsfiddle.net/Khrys/2rcr9j5s/</a></p>
  
  <pre><code>$.validator.setDefaults({
     submitHandler: function() {
        form.submit()
     }
  });
  
  
  $().ready(function() {
  var container = $('div.containerx');
  
      $("#Form").validate({
          ignore: [],
          messages: {
              StartTime: {
                  required: "Select the StartTime."
              }
          },
          errorContainer: container,
          errorLabelContainer: $("span", container),
  
          highlight: function ( element, errorClass, validClass ) {
              $('#StartTime').addClass( "btn-danger" );
              $('#Filter').addClass( "btn-danger" );
          },
          unhighlight: function ( element, errorClass, validClass ) {
              $('#StartTime').removeClass( "btn-danger" );
              $('#Filter').removeClass( "btn-danger" );
          }
      });
  }); 
  </code></pre>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>Class <code>btn-danger</code> needs to be applied to the element correctly.</p>
  
  <p><a href="https://jsfiddle.net/2rcr9j5s/4/">https://jsfiddle.net/2rcr9j5s/4/</a></p>