title: catch .on('change) of textbox within modal
body: <p>I have a modal that contains a text box. I would like to allow the user to simply type in the box and, when their input meets the requirement (length 4), call a function. The issue is the .on('change') function only seems to be processed when you click somewhere in the modal, or close the modal.</p>
  
  <p>I am using bootstrap 3.3.7 and jquery 3.1.1</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#signInModal').modal('show');
  
  $('#signInModal-passwordText').on('change', function() {
    //some diagnostic stuff
    $('#signInModal-failedSpan').show();
    $('#signInModal-failedSpan').html($(this).val());
    if ($(this).val().length == 4) {
      //alert('4');
      signIn($(this).val());
    }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /&gt;
  &lt;div class="modal fade" tabindex="-1" role="dialog" id="signInModal"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;h4 class="modal-title"&gt;Sign In&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;input id="signInModal-passwordText" type="password" class="form-control" /&gt;
          &lt;span class="alert alert-danger" style="display: none;" role="alert" id="signInModal-failedSpan"&gt;Failed!&lt;/span&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- /.modal-content --&gt;
    &lt;/div&gt;
    &lt;!-- /.modal-dialog --&gt;
  &lt;/div&gt;
  &lt;!-- /.modal --&gt;</code></pre>
  </div>
  </div>
  </p>