Radiobutton & Autocomplete

hi

i have 1 search form :





<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'Search',

	'enableClientValidation'=>true,

	'clientOptions'=>array(

		'validateOnSubmit'=>true,


	),


  

)); ?>


	<p class="note">Fields with <span class="required">*</span> are required.</p>





	<div class="row">

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

                <?php $this->widget('CAutoComplete',

                  array(

                                 //name of the html field that will be generated

                     'name'=>'name', 

                                 //replace controller/action with real ids

                     'url'=>array('search/AutoCompleteLookup'), 

                     'max'=>10, //specifies the max number of items to display


                                 //specifies the number of chars that must be entered 

                                 //before autocomplete initiates a lookup

                     'minChars'=>2, 

                     'delay'=>500, //number of milliseconds before lookup occurs

                     'matchCase'=>false, //match case when performing a lookup?


                                 //any additional html attributes that go inside of 

                                 //the input field can be defined here

                     'htmlOptions'=>array('size'=>'40'), 


                     'methodChain'=>".result(function(event,item){\$(\"#user_id\").val(item[1]);})",

                     ));

                  echo CHtml::activeHiddenField($model,'name'); ?>

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

		

	</div>


        <div>

            <?php 

            echo $form->radioButtonList($model,'type',array('names'=>'name $ family','tel'=>'tel','job'=>'job'));

            ?>

        </div>


        





	<div class="row buttons">         

            

            <input type="submit" name="search" value="search" />

	</div>


        


        

        

<?php $this->endWidget(); ?>



I want to this AutoComplete to be filled according to the press RadioButton!

What should I do???

thanks

<?php echo $form->dropDownListRow($model,‘myelement’,array(’’), array(‘onclick’=>‘myfuntion(this.value)’, ‘class’=>‘span5’)); ?>

<script type="text/javascript">

function myfuntion(val){

// see the bellow link for CODE here

}

</script>

http://jqueryui.com/autocomplete/

http://www.yiiframework.com/wiki/361/simple-way-to-use-autocomplete-using-different-id-and-display-value/

http://www.yiiframework.com/wiki/25/using-cautocomplete-to-display-one-value-and-submit-another/

hi

thanks very much

but,I have autocomplete textfield, i want to name of model, selected from dropdown list or radio button. ok??