Niepowtarzalny komunikat o błędzie Knockout Validation
Jak dokładnie ustawić wywołanie zwrotne, aby wyświetlić niestandardowy komunikat o błędzie zamiast domyślnej wiadomości?
ko.validation.rules['exampleAsync'] = {
async: true, // the flag that says "Hey I'm Async!"
validator: function (val, otherVal, callBack) { // yes, you get a 'callback'
/* some logic here */
// hand my result back to the callback
callback( /* true or false */ );
// or if you want to specify a specific message
callback( /* { isValid: true, message: "Lorem Ipsum" } */ );
},
message: 'My default invalid message'
};