一组元素的MVC ForcejQuery验证
var elems = []; var valid = true; ("#Contact").find('.text_input').each(function() { elems.push(this.id); } for (var i = 0; i<= elems.length; i++) { if ($("#" + elems[i]) != undefined) { $("#form1").validate().element("#" + elems[i])) if ($("#" + elems[i]).valid()) { } else { valid = false; } } }
慕工程0101907