title: Jquery datepicker in Bootstrap modal pop up not working as expected
body: <p>I am using <code>jquery datepicker</code> in bootstrap <code>modal popup</code>.Once we open the popup and we can select the date and click on 'Save' button. The <code>popup</code> is closed and page is reloaded and the data is saved in the database.It is working till here as expected. </p>
  
  <p>But, in the following scenario it is not working as expected.</p>
  
  <ul>
  <li>I open <code>popup</code> and close the <code>popup</code> without clicking on <code>'Save'</code> button</li>
  <li>When I open popup again and enter date and click on <code>'Save'</code> it throws <code>jquery</code> undefined error.</li>
  </ul>
  
  <p>Following is my code:</p>
  
  <pre><code>    &lt;div class="modal-body"&gt;
          &lt;div class="form-group"&gt;
          &lt;label for="&lt;%=txtDate.ClientID %&gt;"&gt;Date:&lt;/label&gt;
          &lt;asp:TextBox runat="server"  ReadOnly="true" ID="txtDate"  CssClass="form-control datepicker"&gt;&lt;/asp:TextBox&gt;
      &lt;/div&gt;&lt;hr/&gt;
  &lt;asp:Button ID="btnSave" runat="server" CssClass="btn btn-warning" Text="Save" OnClick="btnSave_Click" UseSubmitBehavior="false" data-dismiss="modal" /&gt;
  &lt;button type="button" class="btn pull-right" data-dismiss="modal"&gt;Close&lt;/button&gt;&lt;/div&gt;
  </code></pre>
  
  <p>My JS code:</p>
  
  <pre><code>&lt;script src="&lt;%=ConfigurationManager.AppSettings["Rootfolder"] %&gt;/Scripts/jquery-ui-1.11.2.js"&gt;&lt;/script&gt;
  
     &lt;script type="text/javascript"&gt;
  
         var txt1 = '#&lt;%= txtDate.ClientID%&gt;';
         $today = new Date();
         $yesterday = new Date($today);
         $yesterday.setDate($today.getDate() - 0);
  
         $(function () {
             $(".datepicker").datepicker({
  
                 dateFormat: "dd/mm/yy",
                 minDate: $yesterday,
                 autoclose : true
             });
  
         });
  
      &lt;/script&gt;
  </code></pre>
  
  <p>Am I missing something? Please let me know if I need to add something as I tried for too long and it is not working as expected.</p>