How To Pass Another Element Value In Cjuiautocomplete

I want to pass the select box value to the cJuiAutocomplete as a additional parameter:I use this code to pass ,value passes correctly but autocomplete not works

My code:


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

            'name'=>'test1',

           'source'=>'js: function(request, response) {

                       $.ajax({

                           url: "'.$this->createUrl('userGroups/AutocompleteTest').'",

                           dataType: "json",

                           data: {

                               term: request.term,

                               type: $("#roll").val()

                           },

                           success: function (data) { 

				

                           }

                       })

                        }',

	        ));

Hi

  1. check this

  2. check

i hope it’s some help.

Thankyou for your reply but shows the formal CJuiAutocomplete code.not helps me in particular :)

i think you may pass the value like


type: 'js:jQuery("#roll").val()'

yeah the value is paasing fine but autocomplete not works…No errors too

try the


success: function (data) {

                response(data);

        }

yeah…data alerts only object object…how to get the particular values

you can see this


 <div class="row">

        <?php echo $form->labelEx($model,'PostalCode'); ?>

        <?php 


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

                'name'=>'Request_PostalCode',

                'value'=>$model->PostalCode,

                'source'=>'js: function(request, response) {

                                $.ajax({

                                    url: "'.$this->createUrl('Request/GetPostalCodes').'",

                                    dataType: "json",

                                    data: {

                                        term: request.term,

                                        countryCode: $("#Request_CountryCode").val()

                                    },

                                    success: function (data) {

                                            response(data);

                                    }

                                })

                             }',

                'options'=>array(

                        'minLength'=>'1',

                        'showAnim'=>'fold',

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

                            {

                                $("#Request_PostalCode").val(ui.item.value);

                                $("#Request_City").val(ui.item.city);

                                return false;

                            }'


                )

                ));


                ?>

        <?php echo $form->error($model,'PostalCode'); ?>

    </div>

Thank you Maggie!..Works like a charm :)