I am trying to get some events to run using knockoutjs and for the life of me cannot figure this out. I’ve made a simple example to demonstrate the most basic idea of the syntax i am using with no success:
<input type="text"
data-bind="event: {onblur: function(){ alert('worked!') }},
value: signUpModel.fullName,
valueUpdate: 'afterkeydown'"
maxlength="40"
id="inputFullName" />
Shouldn’t this work?
You will want to just use
blurinstead ofonblur. The framework handles it properly depending on whether is uses jQuery to attach the event or does it itself (no jQuery available).