I am trying to trigger change event when key is pressed. I subscribed to the observable as shown below but it only detect change after focus is changed.
Edit: for an option binding:
<input class="form-control" type="text" data-bind="inputmask: { value: homePhone, mask: selectedHomePhoneFormat }"/>
in js:
self.homePhone = ko.observable('');
Subscribe:
self.homePhone.subscribe(function (newvalue) {
console.log("changed", newvalue);
});
Above code only detect change after I change focus. I want it to detect change every time when key pressed.