Created
June 13, 2016 11:53
-
-
Save Burick/8fa123b5c538bd0a7e495e9afa55afbe to your computer and use it in GitHub Desktop.
AjaxForm в модалке bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="successModalLabel"> | |
<div class="modal-dialog" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
<h4 class="modal-title" id="successModalLabel">Спасибо</h4> | |
</div> | |
<div class="modal-body"> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script> | |
$(document).on('af_complete', function(event, response) { | |
var form = response.form; | |
if (response.success) { | |
form.parents('.modal').modal('hide'); | |
$('#successModal .modal-body').html(response.message); | |
$('#successModal').modal('show'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment