title: How to open a Bootstrap Modal on change of select Box
body: <p>I am trying to open a modal on the change event of select Box?</p>
  
  <p>This is My Modal</p>
  
  <pre><code>&lt;!-- Modal when adding comment for upload --&gt;
    &lt;div class="modal fade" id="fileUploadModal" role="dialog"&gt;
      &lt;div class="modal-dialog"&gt;
        &lt;!-- Modal content--&gt;
        &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
            &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
            &lt;h4 class="modal-title"&gt;Add Comment&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;
            &lt;p&gt;&lt;textarea id = "commentsUpload"class="form-control custom-control" rows="3" style="resize:none"&gt;&lt;/textarea&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class="modal-footer"&gt;
            &lt;button type="button" class="btn btn-default" onclick="submitXYX()" data-dismiss="modal"&gt;Submit&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>And select Box is:</p>
  
  <pre><code>&lt;select class="selectpicker" id = "selectNEWBox"&gt;
      &lt;option value = "1"&gt;New&lt;/option&gt;
      &lt;option value = "2"&gt;Old&lt;/option&gt;
      &lt;option value = "3"&gt;Scrap&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>What I need to do is to open the <strong>Modal</strong> on change event of select Box.</p>
  
  <p><strong><em>What I have tried</em></strong></p>
  
  <p>In <code>$(document).ready(function () {});</code></p>
  
  <p><strong>Approach 1</strong></p>
  
  <pre><code>$("#selectNEWBox").change(function(){
      $('#fileUploadModal').modal({
      show: true
    });
  });
  </code></pre>
  
  <p><strong>Approach 2</strong></p>
  
  <pre><code>$("#selectNEWBox").change(function (){
      $('#fileUploadModal').modal('show');
  });
  </code></pre>
  
  <p>but these are not working.</p>
  
  <p>Am I missing something?</p>