0
在我的表單中,當我在默認情況下使用表單ID上的jQuery驗證驗證所有字段時,我有4個字段。我只想驗證1個必填字段。如何僅在特定字段上使用jquery驗證
我jQuery是如下
jQuery.noConflict();
jQuery的(文件)。就緒(函數(){
jQuery("#add-color-form").validate(
{
rules: {
color_name: {
required:true,
maxlength: 20
},
},
messages: {
color_name: {
required: "Please enter color name",
maxlength: "Not more than 20 characters"
},
}
}
);
}
不過它驗證所有的字段,而我想只在1場
你可以發佈你的HTML嗎? – Samich
我已經解決了它 類使用所需 僅針對特定強制字段及其工程所需的用途。 –