CJuiAutoComplete onSelect Event

I’ve the following auto complete control in my view:

<?php

	//echo &#036;form-&gt;textField(&#036;model, 'diag1_name', array('maxlength' =&gt; 150));

$this->widget(‘zii.widgets.jui.CJuiAutoComplete’, array(

'name'=&gt;'dsm1',


'value'=&gt;&#036;model-&gt;diag1_name,


//'source'=&gt;array('junk', 'junk1', 'junk2'),


'source'=&gt;&#036;this-&gt;createUrl('Sessions/autocompleteDiagnosis14'),


'htmlOptions'=&gt; array ([color=&quot;#8B0000&quot;]'onSelect' =&gt; 'function(value, data){ alert(&#092;'You selected: &#092;' + value + &#092;', &#092;' + data); }'[/color]),


// additional javascript options for the autocomplete plugin


'options'=&gt;array(


        'showAnim'=&gt;'fold',[color=&quot;#8B0000&quot;]'onSelect' =&gt; 'function(value, data){ alert(&#092;'You selected: &#092;' + value + &#092;', &#092;' + data); }'[/color],


),));

?>

This works perfectly. I’d like to do some post processing on the client-side. I’ve added the onSelect event java script. I’ve tried this as part of options, and also as part of htmlOptions. Somehow, it’s not working.

Please help.

It is select, I believe?




'options'=>array(

   'minLength'=>2,

   'showAnim'=>'fold',

   'select'=>"js: function(event, ui){ alert('You selected: ' + ...); }"

)