人数を入力する3つの入力フィールドがあり、そのうちのどれが大人で何人が子供であるかが分かります。私はどこ 子供+大人のカスタムメソッドを追加するためのプラグインを検証jQueryのを使用しようとしています=人jQueryは複数のフィールドにまたがって検証します
の数は、これは私の検証コール
$("#form2").validate({
errorElement: "span",
rules: {
attendees: {
required: true,
digits: true
},
adults: {
required: true,
digits: true
},
children: {
required: true,
digits: true
}
},
messages: {
attendees: "Enter the number of persons (including yourself)",
adults: "Enter number of adults",
children: "Enter number of childern"
}
});
である私は、検証プラグインのグループ機能とaddMetodを見て一つの要素だけを念頭に置いて作られたようだ。何か案は ?
'.each()'ステートメントでそれを投げることができますか? –