Created
November 6, 2018 00:37
-
-
Save ru2fac/ddfbc6918b88410db5b5803149b3d50d to your computer and use it in GitHub Desktop.
Сообщение об успешной отправке AjaxForm в модалке на Fancybox
This file contains 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).ready(function() { | |
AjaxForm.Message.success = function() {}; | |
}); | |
$(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> |
This file contains 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
<script> | |
$(document).ready(function() { | |
AjaxForm.Message.success = function() {}; | |
}); | |
$(document).on('af_complete', function(event, response) { | |
var form = response.form; | |
if (response.success) { | |
$.fancybox.close(); | |
$.fancybox('<h1>' + response.message + '</h1>'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Взято тут: https://ilyaut.ru/cheats/message-about-successful-sending-ajaxform-in-module/