I’ve the following auto complete control in my view:
…
<?php
//echo $form->textField($model, 'diag1_name', array('maxlength' => 150));
$this->widget(‘zii.widgets.jui.CJuiAutoComplete’, array(
'name'=>'dsm1',
'value'=>$model->diag1_name,
//'source'=>array('junk', 'junk1', 'junk2'),
'source'=>$this->createUrl('Sessions/autocompleteDiagnosis14'),
'htmlOptions'=> array ([color="#8B0000"]'onSelect' => 'function(value, data){ alert(\'You selected: \' + value + \', \' + data); }'[/color]),
// additional javascript options for the autocomplete plugin
'options'=>array(
'showAnim'=>'fold',[color="#8B0000"]'onSelect' => 'function(value, data){ alert(\'You selected: \' + value + \', \' + 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.