jQuery验证插件和Colorbox [英] Jquery Validation plugin and Colorbox
本文介绍了jQuery验证插件和Colorbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人提交提交已动态加载到Jquery Colorbox模态窗口的表单时,是否有人知道让Jquery Validation插件运行的最佳方法?
Does anyone know the best way to get the Jquery Validation plugin to run when submitting a form that has been loaded dynamically into a Jquery Colorbox modal window?
推荐答案
将验证设置添加到colorbox回调中.这样,在您尝试为其设置验证之前,已经加载了颜色框,并且表单已经存在.
Add the validation set up to the colorbox callback. That way the color box has been loaded and the form exists before you attempt to set up validation for it.
$('selector').colorbox({...options...}, function() {
$('form',this).validate( {...options...} );
});
这篇关于jQuery验证插件和Colorbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文