简体   繁体   English

带有jQuery Tabs的jQuery Load-不干扰验证

[英]jQuery Load with jQuery Tabs - Unobtrusive Validation

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 . 我正在使用jQuery Tabs,并且正在使用tabsbeforeactivate事件加载标签页,以便仅在需要时通过Ajax加载内容。

I am facing difficulties since I need to manually enable Unobrusive Validation after injecting the respective contents. 我面临困难,因为我需要在注入相应内容后手动启用Unobrusive验证。 I am using the $('#tabs-0').load and the $.validator.unobtrusive.parse($(result)); 我正在使用$('#tabs-0')。load$ .validator.unobtrusive.parse($(result)); when completed. 完成时。

I don't know why but I still don't get the Unobtrusive Validation. 我不知道为什么,但是我仍然没有得到Unobtrusive Validation。

Thanks a lot 非常感谢

I was able to do it using the Load Callback Function. 我能够使用Load Callback Function做到这一点。

When the Load mehtod is completed I call the: 加载方法完成后,我将调用:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM