我有一个带有“预览”按钮的表单,它使用jQuery表单ajaxSubmit将表单内容提交到预览页面,成功回调函数在fancybox中显示该请求的内容,使用“Continue”按钮正常提交表格并继续第二页。
首次点击“预览”时,所有这一切都按预期工作,然后关闭fancybox,然后在“预览”的后续点击中,我显示错误。
任何想法都让我疯狂了几个小时。
我正在使用jQuery 1.10.2和jQuery Form Plugin 3.51.0以及jQuery Fancybox 2.1.5。
function successFunction(responseText)
{
$.fancybox({
'content' : responseText
});
}
$(document).ready(function() {
var ajaxFormOptions = {
success: successFunction, // post-submit callback
url: '{{ path('StarthereRewardsfromusBundle_preview1') }}' // override for form's 'action' attribute
};
$('form').click(function(event) {
if (event.target.innerHTML == "Preview")
{
$(this).ajaxSubmit(ajaxFormOptions);
return false;
}
else if (event.target.innerHTML.indexOf("Continue") == 0)
{
}
});
});
提前致谢...我希望: - )