So after submit a form for a review, i'd like to have a modale popup to thank the customer and autoclose after a delay. I have this code :
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES); ?>" id="feedbackForm" data-toggle="validator" data-disable="false" method="post">
<button type="submit" value="Submit" title="Post your review" class="btn btn-primary btn-lg" data-loading-text="Sending..." style="display: block; margin-top: 10px;">Send <span class="glyphicon glyphicon-send"></span></button>
</form>
<div id="dialog" style="display: none">
Thank you for your review, this dialog will automatically close in 10 seconds.
</div>
</div>
<script type="text/javascript">
$(document).ready(function ()
{
;(function($) {
// DOM Ready
$(function() {
// Binding a click event
// From jQuery v.1.7.0 use .on() instead of .bind()
$('#my-button').on('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
$('#feedbackForm').ajaxForm(function () {
$('#dialog').bPopup({
autoClose: 3000,
easing: 'easeOutBack', //uses jQuery easing plugin
speed: 450,
transition: 'slideDown'
});
});
});
});
});
})(jQuery);
</script>
It submit the form but the modale popup doesn't open... Thank you for your help !