title: Prevent modal dismiss till ajax response
body: <p>I want to prevent bootstrap modal from dismissing until a ajax response or even not to dismiss  if response is false,lets say.
  <br>Here is the code:
  Modal body only:</p>
  
  <pre><code>    &lt;div class="modal-body"&gt;    
  &lt;div class="control-group"&gt;
  &lt;div class="controls"&gt;
      &lt;label for="sharedUser" class="control-label right"&gt;Share With:&lt;/label&gt;
      &lt;input type="text" name="sharedUser" id="sharedUser"  placeholder="Username to Share"&gt;
      &lt;label class="help-block errorLabel fl width100" id="kpiNameError"&gt;&lt;/label&gt;                                                         &lt;/div&gt;
      &lt;/div&gt;  &lt;/div&gt;
  </code></pre>
  
  <p>here is the script that determine what to do with modal:</p>
  
  <pre><code>function shareKpi(kpiId,username){
                  var shareUrl = "${createLink(action:'shareKpi',controller:'dashboard')}"
                  var msg;
                  jQuery.ajax({
                      type: 'POST',
                      url: shareUrl,
                      data: "kpiId="+kpiId+"&amp;sharedUser="+username,
                      success: function(response,textStatus){
                          msg=response;
                       },
                      error:function(XMLHttpRequest,textStatus,errorThrown){}
                  });
                  return false;
              }
  </code></pre>
  
  <p>What i want is modal not to be dismissed until ajax response.
  <br>Actually even i am not clear about the question and this question is open to further edits or suggestions.<br>thanks in advance</p>