0
フィールドの検証にカスタムエラーメッセージを追加しようとしましたが、デフォルトのものを使用するのではなく、さまざまなオプションを試しても機能しません。以下は私のコードスニペットです。助けてください!Jqueryのバリデーションを使用してカスタムエラーメッセージを追加する
$('#myform').validate({ // initialize the plugin
submitHandler: function (form) {
console.log("Submitted!");
},
rules: {
accountNumber: {
required: true,
minlength: 8,
maxlength: 8,
min: 11111111,
digits: true
},
companyNumber: {
required: true,
digits: true
}
},
messages: {
min: 'Account number cannot be 00000000',
max: 'Account number cannot be 00000000',
digits: 'The account number must be a number'
}
});
});
パーフェクト...ありがとう! – sam