简体   繁体   English

jQuery验证引擎动态字段验证

[英]jQuery Validation engine Dynamic field validation

I'm using jQuery validation engine for field validation 我正在使用jQuery验证引擎进行字段验证

On page load there are already fields available, and the validation works correct for them, but there are some buttons which add fields dynamically, and those validations won't work obviously :) I tried initializing the instance again but it doesn't work. 在页面加载时,已经有可用的字段,并且验证可以正确地使用它们,但是有一些按钮可以动态添加字段,这些验证显然不会起作用:)我尝试再次初始化实例,但是它不起作用。

Is there a method by which I can manually add validation instance to those field which I have added dynamically 有没有一种方法可以将验证实例手动添加到我动态添加的那些字段中

EDIT: Sorry forgot to mention, I'm using this plugin http://www.position-relative.net/creation/formValidator/index.html 编辑:抱歉忘了提及,我正在使用此插件http://www.position-relative.net/creation/formValidator/index.html

Thanks, Mo 谢谢莫

This article helped me very much: http://xhalent.wordpress.com/2011/01/24/applying-unobtrusive-validation-to-dynamic-content/ 本文对我有很大帮助: http : //xhalent.wordpress.com/2011/01/24/applying-unobtrusive-validation-to-dynamic-content/

You should validate a container in which you have dynamically added elements 您应该验证其中已动态添加元素的容器

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

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