本文介绍了jQuery的验证不工作在ThickBox的显示Ajax调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯使用3.1 ThickBox的使用jQuery 1.3.2的验证插件,所有当我单独运行的网页的伟大工程,但是当我使用ThickBox的页面弹出(因为它应该),但页面上的验证,现在不工作(内ThickBox的),有这方面的帮助将是巨大的。

Im using Thickbox 3.1 with jQuery 1.3.2 with the Validation plugin and all works great when I run the pages individually but when I use Thickbox the page popup (As it should) but the validation on the page now doesn't work (Inside the Thickbox), any help on this would be great.

顺便说一句奇怪的是,ThickBox的看起来是工作在里面的​​ThickBox但不验证(这是网页本身)。

BTW the strange thing is that Thickbox looks to be working inside the thickbox but not the validation (Which is on the page itself).

谢谢,--Phill

Thanks,--Phill

添加code:

page1.html(JavaScript的)

page1.html (JavaScript)

$(document).ready(function(){
            $("#page1Form").validate({
                rules: {
                    "field1": {
                        required: true,
                        digits: true
                    },
                    "field2": {
                        required: true
                    }
                },
                errorElement: "div"
            });
        });

index.html的(ThickBox的链接)

index.html (Thickbox link)

<a href="page1.html" class="thickbox">Page 1</a>

我可以查看源代码的弹出ThickBox的,我看到所有的JS code和库是有,但它没有运行在ThickBox的弹出验证。

I can view source on the Thickbox popup and I see all the JS code and libraries are there but it's not running the validation in the Thickbox Popup.

推荐答案

我觉得即使handelers正在在页面加载设置,因此不会设置上的ThickBox生成的html。你能不能设置一个回调来启动validationi中的ThickBox ajaxloads内容后?

I think the even handelers are being set on page load, so they aren't set on the thickbox generated html. Can't you set a callback to start the validationi after the thickbox ajaxloads the content?

这篇关于jQuery的验证不工作在ThickBox的显示Ajax调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 22:27