之後彈出一個模型彈出窗口。所以在提交表單進行審查之後,我想要一個模式彈出窗口來感謝客戶並在延遲後自動關閉。 我有這樣的代碼:我想在提交表格
<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>
它提交表單,但modale彈出窗口不會打開... 謝謝您的幫助!
謝謝你,是的,我包括jQuery的,如果我刪除的: 「$( '#feedbackForm')給ajaxForm(函數(){」,該modale彈出窗口打開並autoclose,但表單不提交然後...... – seb606