Using keypress event in knockout JS

  1. make sure query is an observable
  2. use valueUpdate="afterkeydown"
  3. use event: { 'keyup': check }:

Also I’d use console.log if possible as opposed to alert, and log the query so you can make sure the value is updating. 🙂 you also my want to log the event like this

function check(data, event) {
    console.log(event);
}

that will tell you the keycode for the key you pressed

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)