title: Bootstrap maxlength doesn't work in modal dialog
body: <p>I'm using Bootstrap Maxlength plugin to show the maximum lenght of a field while the user is inserting text. It works well with input fields and textareas of a page. The problem is that it doesn't work when the input or the textarea field is in a modal dialog.</p>
  
  <p>I have this javascript code:</p>
  
  <pre><code>$(document).ready(function () {
    $('input.max-length-field').maxlength({
      limitReachedClass: "label label-danger",
      alwaysShow: true
    });
    $('textarea.max-length-field').maxlength({
      limitReachedClass: "label label-danger",
      alwaysShow: true
    });
  });
  </code></pre>
  
  <p>So all inputs and textareas with "max-length-field" class, should display the remaining chars. But when the field is in a modal dialog, it doesn't work.</p>
  
  <p>How can I get this working?</p>
  
  <p>EDIT:</p>
  
  <p>HTML looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  ...
  &lt;html&gt;
  ...
  &lt;head&gt;...&lt;/head&gt;
  &lt;body&gt;
  ...
  &lt;div id="myModal" class="modal fade" tabindex="-1" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  ...
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;div class="col-md-12"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-3"&gt;
                              My Field
                          &lt;/div&gt;
                          &lt;div class="col-md-9"&gt;
                              &lt;input name="mymodalfield" type="text" maxlength="150" id="idmymodalfield" class="form-control max-length-field" /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="clearfix"&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" data-dismiss="modal" class="btn default"&gt;Close&lt;/button&gt;
                  &lt;input type="submit" name="myModalButton" value="Yes" onclick="...." class="btn" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  ...
  ...
  &lt;div class="row"&gt;
      &lt;div class="col-md-12"&gt;
      ...
      &lt;input name="myfield" type="text" maxlength="10" id="idmyfield" class="form-control max-length-field" /&gt;
      ...
      &lt;/div&gt;
  &lt;/div&gt;
  ...
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Bootstrap Maxlength is working well with "myfield" input, but it doesn't appear in "mymodalfield".</p>