activeTextField on key press

Hello,

I created an activeTextField




<?php 

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

     'ajax'=>array(

     'type'=>'POST',

     'url'=>'view/name',

     'update'=>'#req_res'

)

)); 

?>

<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).

Thanks,

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