在表格关闭的fancybox的iframe提交使用按钮标记 - 不工作 [英] Close Fancybox iframe on form submit using BUTTON tag - not working

查看:165
本文介绍了在表格关闭的fancybox的iframe提交使用按钮标记 - 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据该API的fancybox,我使用的iframe以下code:

According to the Fancybox API, I am using the following code in an iframe:

<form>

... // form fields here

<button onclick="parent.$.fancybox.close();">
<span>Save</span>
</button>

</form>

的形式实际上关闭时,保存点击 - 但形式的内容尚未提交。这就像关闭事件被触发前的形式实际上提交其内容。

The form actually closes when 'Save' is clicked -- but the form content is not submitted. It's like the close event is triggered before the form actually submits its content.

如果没有的onclick ,内容提交,但随后的页面中的iframe内打开 - 不是我想要的。

Without the onclick, content is submitted, but the subsequent page opens inside the iframe -- not what I want.

有没有办法解决?

感谢您的帮助。

推荐答案

我结束了使用多个创建按钮解决这个跨度(样式目的)和几行的jQuery

I ended up solving this by creating buttons using multiple span (for style purposes) and a few lines of jQuery

<span id="save_btn" class="fc-button fc-button-prev fc-state-default fc-corner-left fc-corner-right">
        <span class="fc-button-inner">
            <span class="fc-button-content save_button">Save</span>
            <span class="fc-button-effect">
                <span></span>
            </span>
        </span>
</span>

<script>
$('#save_btn').click(function() {
  $('#my_form').submit();
});
</script>

这篇关于在表格关闭的fancybox的iframe提交使用按钮标记 - 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆