zii.widgets.jui.CJuiAutoComplete, javascript problem

Hi guys,

I am having a hard time getting the autocompletion to work as CJuiAutoComplete widget. I a, using Yii 1.7, and this is the widget code:


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





    'source'=> array('one', 'two', 'three'),





        'select'=>"js:function(event, ui) {

            var terms = split(this.value);

            // remove the current input


            // add the selected item

            terms.push( ui.item.value );

            // add placeholder to get the comma-and-space at the end


            this.value = terms.join(', ');

            return false;








I will use an ajax request, but want to make it work with a more simple source first. Anyways, as you can see I want to use multiple selections, and the values of the source is showing as expected. The problem occurs if I want to select one from the list, either by mouse or keyboard.

The error I get is: Error: split is not defined Source File: http://localhost/site/test Line: 260

So it is an JS error, but how can I fix it? As far as I know the widgets handle their own assets.

Any help is much appreciated as I have wasted alot of time this far:-)



check the documentation for javascript split method… and use it appropriately :D