带有jQuery选项卡的jQuery加载-不显眼的验证 [英] jQuery Load with jQuery Tabs - Unobtrusive Validation

查看:78
本文介绍了带有jQuery选项卡的jQuery加载-不显眼的验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jQuery Tabs ,并且正在使用 tabsbeforeactivate 事件加载标签页,以便仅在需要时通过 Ajax 加载内容. >.

我面临困难,因为我需要在注入各自的内容后手动启用Unobrusive Validation.完成后,我将使用 $('#tabs-0').load $.validator.unobtrusive.parse($(result)); . >

我不知道为什么,但是我仍然没有得到不干扰用户的验证.

非常感谢

解决方案

我能够使用 Load 回调函数来做到这一点.

加载方法完成后,我将呼叫:

$.validator.unobtrusive.parse($(result))

http://api.jquery.com/load/

I am using jQuery Tabs and I am loading the tab pages using the tabsbeforeactivate event, so that I only load contents when needed through Ajax.

I am facing difficulties since I need to manually enable Unobrusive Validation after injecting the respective contents. I am using the $('#tabs-0').load and the $.validator.unobtrusive.parse($(result)); when completed.

I don't know why but I still don't get the Unobtrusive Validation.

Thanks a lot

解决方案

I was able to do it using the Load Callback Function.

When the Load mehtod is completed I call the:

$.validator.unobtrusive.parse($(result))

http://api.jquery.com/load/

这篇关于带有jQuery选项卡的jQuery加载-不显眼的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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