如何让我的 jQuery 多阶段表单在成功提交时淡出并且结果淡入?我将它与 jQuery 表单插件 (http://jquery.malsup.com/form/) 一起使用。
这是我处理所有提交的 jQuery 表单代码。
<script type="text/javascript">
// prepare the form when the DOM is ready
$(document).ready(function() {
var options = {
target: '#t5',
beforeSubmit: showRequest,
success: showResponse
};
// bind to the form's submit event
$('#t5_booking').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
});
// pre-submit callback
function showRequest(formData, jqForm, options) {
var queryString = $.param(formData);
// alert('About to submit: \n\n' + queryString);
}
// post-submit callback
function showResponse(responseText, statusText, xhr, $form) {
}
</script>
这是与它一起工作的多阶段形式: