jquery validate怎么动态添加验证规则

2024-12-14 18:03:24
推荐回答(1个)
回答1:

代码如下
You could use either $('input[type=text]') or $('input:text')
$("input[name^='Text1']").each(
function() {
$(this).rules("add", { required: true, messages: { required: "也是必填"} });
}
)