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