Using keypress event in knockout JS



  • 2 Answer(s)
    • Check that the query is an observable
    • Use   valueUpdate = ‘afterkeydown’
    • Use   event: { ‘keyup’: check }:

       Use the  console.log if possible as opposed to alert, and log the query to check the  value is updating.. For log the event ,See this

    function check(data, event)
    {
      console.log(event);
    }
    
    Answered on November 23, 2018.
    Add Comment

       The KO docs, at least as of now, specifically addresses this issue:

    Note 1: textInput vs value binding

       Eventhough the value binding do two-way binding between text boxes and viewmodel properties, Then prefer the textInput whenever sudden live updates is needed.

    See   http://knockoutjs.com/documentation/textinput-binding.html

    Answered on November 23, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.