L
L
lasermedcentre2015-01-26 13:46:15
HTML
lasermedcentre, 2015-01-26 13:46:15

How to display modal window after page reload in Bootstrap?

There is a page. It has a form on it.
After submitting the form, the page is reloaded and a message about the status of the completed form is displayed (an error in filling in some field, or a success message).
How can I display this message in a modal window? What container to wrap it in?
Example

<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">Small modal</button>

<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      ...
    </div>
  </div>
</div>

Does not help. Because after clicking the button, the page reloads...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Belkin, 2015-01-26
@BelkinVadim

$('.modal').modal('show');
Opening a modal window. After reboot, call, or by clicking on the button, do e.preventDefault(); and load the modal dynamically and open it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question