I am researching the knockout validator plugin. I have an input text control in the view:
Prefix:
<input data-bind = "value: Prefix" />
I am doing some validation on the Prefix observable variable:
Prefix.extend({
minLength: 3,
required: true
});
The validation is working but when I enter one character in the input text box and change the focus the message for required rule is shown, not that for minLength. I tried some alternative syntax:
Prefix.extend({ required: true })
.extend({ minLength: 3 })
But nothing changes. If I enter the minimum required characters and then delete them one by one, the correct rule messages are triggered (minLength message and required message when no characters are left). I am not very much familiar with javascript and I cannot figure out what am I doing wrong. Any help will be appreciated. Thank You!