title: Bootstrap datepicker in modal not working
body: <p>I've tried to google and search SO for a similar question, but haven't found anything as of yet.
  I have an issue where I create and open a modal from jquery and try to access a date picker, however it doesn't activate the datepickers JS.</p>
  
  <pre><code>$("[id=add]").click(function () {
      $("#myModal .modal-header h4").html("Request for Change");
      $("#myModal .modal-body").html('&lt;form class="form-horizontal" role="form"&gt;&lt;br /&gt;&lt;br /&gt;&lt;label class="col-sm-2 control-label"&gt;Date Required&lt;/label&gt;&lt;div class="col-sm-3"&gt;&lt;div class="input-group date col-sm-8"&gt;&lt;input type="text" class="form-control" id="DateRequired"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-th"&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;');
      $("#myModal").modal("show");
  });
  </code></pre>
  
  <p>(Apologies about the long line length, however I have removed as much as I can - just showing the code which relates to the problem now.)</p>
  
  <p>I have these scripts referenced at the top:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  &lt;script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/jquery.tablesorter.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And in the same <code>&lt;script&gt; &lt;/script&gt;</code> tag as the jquery function above, at the very top I have:</p>
  
  <pre><code>$('.input-group.date').datepicker({
      format: "dd/mm/yyyy",
      startDate: "01-01-2015",
      endDate: "01-01-2020",
      todayBtn: "linked",
      autoclose: true,
      todayHighlight: true
  });
  </code></pre>
  
  <p>I have this code used in an similar way (except no jquery modal - simply on a cshtml page) that works correctly. I don't know why this way won't work. I've used developer tools to try to trace an issue, but there are no errors - the scripts load correctly however when clicking the Date Required it doesn't fire to the jquery for datepicker.</p>
  
  <p>Am I using the Jquery html wrong to create the modal? </p>
  
  <p>Cheers</p>