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?
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?
Share Improve this question edited Feb 24, 2014 at 22:38 Jeroen 63.8k46 gold badges228 silver badges366 bronze badges asked Jul 27, 2011 at 18:36 billy jeanbilly jean 1,4294 gold badges27 silver badges46 bronze badges1 Answer
Reset to default 10You will want to just use blur
instead of onblur
. The framework handles it properly depending on whether is uses jQuery to attach the event or does it itself (no jQuery available).