O
O
Oleg Voitenko2014-12-25 16:23:50
JavaScript
Oleg Voitenko, 2014-12-25 16:23:50

How to automatically close Bootstrap modal window after Ajax success=1?

I'm just starting to tinker with BT.
I have a task like this:

1. there is a form:

<div class="modal fade bs-example-modal-sm" id="cardModal1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
   <div class="otpiska modal-dialog modal-sm">
       <div class="modal-content">
      <button class="close" data-dismiss="modal" type="button"></button>
          <h4>ЗАКАЗ ОБРАТНОГО ЗВОНКА</h4>
          <p>Пример: +38 (067) 123-45-67</p>
          <form class="send-form">
        <input type="text" class="w_100" placeholder="Ф.И.О." name="name" id="name" required="required">
        <input type="text" class="w_100" placeholder="Телефон" name="phone" id="phone" required="required">
        <input type="hidden" class="w_100" value="Заказ обратного звонка" name="action" id="action">
        <input type="submit" value="ОТПРАВИТЬ">
        </form>
          </div>  
    </div>
     </div>


there is a simple Ajax
success handler: function(response) {
Here is the question, what should be written so that the specified modal closes if successful?
(I've already tried a lot of options, none of them worked), that is, data-dissmiss="modal" worked
}

I hope I explained the problem clearly.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question