title: Open a Modal from another modal and close the first (launching) modal
body: <p>I'm using Bootstrap Modal Window plugin its work fine but i would like to open another model window when i click next and close first one. how can i do it?</p>
  
  <pre><code>$('[data-toggle="modal"]').click(function(e) 
      {
          e.preventDefault();
          var url = $(this).attr('href');
          if (url.indexOf('#') == 0)
          {
              $(url).modal('open');
          } 
          else 
          {
              $.get(url, function(data) 
              {
                  $(data).modal();
              }).success(function() { $('input:text:visible:first').focus(); });
          }
      });
  
  &lt;a href="next.html" data-toggle="modal"&gt;Add Record&lt;/a&gt;
  </code></pre>
  
  <p>next.html File Code</p>
  
  <pre><code>&lt;div class="modal fade" id="compose-modal" role="dialog" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class="modal-title"&gt;First Window&lt;/h4&gt;
              &lt;/div&gt;
              &lt;form action="#" method="post"&gt;
  
                  &lt;div class="modal-footer clearfix"&gt;
                      &lt;button type="button" data-dismiss="modal"&gt;Discard&lt;/button&gt;
  
                      &lt;button type="submit"&gt;Submit&lt;/button&gt;
                       &lt;a href="next2.html" data-toggle="modal" &gt;Next&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>