I am trying to set up a knockout check, but my settings seem to be ignored. This is how I try to configure it
var knockoutValidationSettings = {
insertMessages: true,
decorateElement: true,
errorMessageClass: 'error',
errorElementClass: 'error',
errorClass: 'error',
errorsAsTitle: true,
parseInputAttributes: false,
messagesOnModified: true,
decorateElementOnModified: true,
decorateInputElement: true
};
ko.validation.init(knockoutValidationSettings);
ko.applyBindings(vm, $('#dropzone')[0]);
I know the options object is not a problem because it works fine
var knockoutValidationSettings = {
insertMessages: true,
decorateElement: true,
errorMessageClass: 'error',
errorElementClass: 'error',
errorClass: 'error',
errorsAsTitle: true,
parseInputAttributes: false,
messagesOnModified: true,
decorateElementOnModified: true,
decorateInputElement: true
};
ko.applyBindingsWithValidation(vm, $('#dropzone')[0], knockoutValidationSettings);
How can I make the init function work? Obviously, I would like to move this initialization to one place in the root of my application.
source
share