activeTextField on key press


I created an activeTextField


echo CHtml::activeTextField($model,'name',array(








<div id="req_res">...</div>

I would like to do the post request on every key press (do I need onkeyup or onchange then?) what do I need to change on the above code to do this? Now it does the POST request when the input field loses focus.

Regarding the first point, use onkeyup as I believe the onchange event is only fired once the control loses focus (at least in Chrome).


Where can I add the onKeyup event in the above code?