Radiobutton & Autocomplete


i have 1 search form :

<div class="form">

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







)); ?>

	<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',


                                 //name of the html field that will be generated


                                 //replace controller/action with real ids


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

                                 //specifies the number of chars that must be entered 

                                 //before autocomplete initiates a lookup


                     '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




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

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





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




	<div class="row buttons">         


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





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

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

What should I do???


<?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




thanks very much

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