Skip to content

Instantly share code, notes, and snippets.

@Burick
Created June 13, 2016 11:53
Show Gist options
  • Save Burick/8fa123b5c538bd0a7e495e9afa55afbe to your computer and use it in GitHub Desktop.
Save Burick/8fa123b5c538bd0a7e495e9afa55afbe to your computer and use it in GitHub Desktop.
AjaxForm в модалке bootstrap
<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