title: Uncaught TypeError: Cannot read property 'split' of undefined - bootstrap datepicker
body: <p>i am using bootstrap datepicker for the input in bootstrap modal window. When I opened this windows for the first time, everything is ok and datepicker works fine. When I close this modal window and opened it again, my js console says <code>Uncaught TypeError: Cannot read property 'split' of undefined</code> </p>
  
  <p>I'm loading form in modal window with ajax.</p>
  
  <p>This is my modal window:</p>
  
  <pre><code>&lt;div id="finalModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt;
                  &lt;h3 id="myModalLabel"&gt;Final date&lt;/h3&gt;
              &lt;/div&gt;
              &lt;div class="modal-body" id="finalModalBody"&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button id="finalSubmit" class="btn btn-success"&gt;Save&lt;/button&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>After loading this window, this script is started:</p>
  
  <pre><code>$('.datepicker').datepicker({
             format: "dd.mm.yyyy"
  })
  </code></pre>
  
  <p>And this is my formin modal window:</p>
  
  <pre><code>&lt;form&gt;
  &lt;p&gt;&lt;select onfocus="this.onmousewheel=function(){return false}" class="prereservationSelect" name="prereservation" id="frmfinalForm-prereservation"&gt;&lt;option value="89"&gt;15. 7. 2014 - 19. 7. 2014&lt;/option&gt;&lt;option value="0"&gt;second date&lt;/option&gt;&lt;/select&gt;&lt;/p&gt;
  &lt;div id="otherDate" style="display: none"&gt;
      &lt;p&gt;&lt;strong&gt;&lt;label for="frmfinalForm-otherDate"&gt;Zvolte jiný termín:&lt;/label&gt;&lt;/strong&gt;&lt;/p&gt;
      &lt;p style="float: left"&gt;&lt;input type="text" class="datepicker text" name="otherDate" id="frmfinalForm-otherDate" value=""&gt;&lt;/p&gt;
      &lt;p style="margin-top: 15px; margin-left: 250px" id="date"&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thanks for any advice.</p>