jQuery Validate - Onsubmit 不要离开页面并删除字段中的输入数据

发布于 2024-09-12 07:37:09 字数 954 浏览 2 评论 0原文

我收到了提交的表单,然后我希望使用 fancybox 弹出插件将我刚刚提交的数据显示在 iframe 中。

该表单通过 Jörn 的 jQuery 验证插件进行验证,当我单击提交按钮时,表单会检查所有内容是否都按预期进行验证,并将我发送到另一个页面,因为

我希望将表单提交到另一个页面如果可能的话,我会在 fancybox iframe 框中显示。并且后台仍然有表单,显示字段中的所有文本输入,就像提交时一样。

我遇到的问题是,我无法将提交按钮连接到 fancybox 插件,因此它将在“iframe”弹出窗口中向我显示另一个页面,其中包含显示我提交的所有数据的确认页面。

我尝试使用这个:

$(".confirmation").fancybox({

        'autoDimensions'    : true,
        'width'             : 800,
        'height'            : 300,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'overlayColor'      : '#000000',
        'overlayOpacity'    : 0.8,
        'type'              : 'iframe'
});

我给了提交按钮另一个ID:

<input type="submit" id="submit confirmation" name="submit" value="Send" href="/secpak/confirmation/" />

这也不起作用,尝试了其他一些东西,但我仍然无法让它工作,这个世界上有任何其他人有任何想法或提示和技巧来获得这个东西去工作?

最好的问候,

EIGHTYFO

I got a form that I submit and then Id like to have the data I just submitted show up in a iframe with the fancybox popup-plugin.

The form is validated via jQuery validate plugin from Jörn, and when I click the submit button the form checks if everything validates as it should, and it sends me to the other page because of the

I want to have the form submitted to another page that Ill show in a fancybox iframe box if that is possible. And still have the form in the background showing all the text-input in the fields as it was when it was submitted.

The problem I got is that I cannot connect the submitbutton to the fancybox plugin so it will show me the other page in an "iframe" popup with the confirmation page that shows all the data I submitted.

I tried to use this:

$(".confirmation").fancybox({

        'autoDimensions'    : true,
        'width'             : 800,
        'height'            : 300,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'overlayColor'      : '#000000',
        'overlayOpacity'    : 0.8,
        'type'              : 'iframe'
});

I gave the submitbutton another ID:

<input type="submit" id="submit confirmation" name="submit" value="Send" href="/secpak/confirmation/" />

That didnt work either, tried a few other things but I still cant get it to work, any other guys in this world that got any ideas och tips and tricks to get this stuff to work?

Best Regards,

EIGHTYFO

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆沫 2024-09-19 07:37:10

您指定的 ID 无效(包含空格)。我猜你的意思是“class”属性,而不是“id”。 jQuery 选择器也表明它应该是类;)

you're specifying invalid id (contains space). I guess you meant "class" attribute, not "id". also the jQuery selector suggests it was supposed to be class ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文