title: How to Update textfield onchange of dropdownlist without refresh page in Yii?
body: <p>I have a Yii dropdownlist and text field, when i select the dropdown list item, this name should be displayed in textfield. I tried this concept using ajax with But it updates after page refresh  only.I have pasted my code here, please look-through and suggest me how to set
  textfield after every immediate  selection of drop down listed item.</p>
  
  <pre><code>   The following code resides protected/views/form
  
      &lt;td&gt;    
      &lt;?php echo $form-&gt;labelEx( ScriptQuestion::model(),'Field'); ?&gt;&lt;/td&gt;&lt;td&gt;
      &lt;?php echo CHtml::activedropDownList( ScriptQuestion::model(),'crm_base_contact_form_field_id',$select_field,       
                  array(
                  'id' =&gt; 'send_bcfield',
                  'class' =&gt; 'col_165',
                  'ajax' =&gt; array(
                      'type' =&gt; 'POST',
                      'url' =&gt; CController::createUrl('DisplayMessage'),                                                               
                      'update' =&gt; '#question_editor',
                      'data' =&gt; array('bcfield' =&gt; 'js:this.value'),
                      'success'=&gt; 'function(data) {$("#question_editor").empty();
                              $("#question_editor").val(data);
                              } ',                    
                      ))      
      ); ?&gt;               
      &lt;/td&gt;
           &lt;td&gt;
          &lt;?php echo $form-&gt;textArea($model, 'message', array('id'=&gt;'question_editor','maxlength'=&gt;508, )); ?&gt;
             &lt;/td&gt;
  </code></pre>
  
  <p>This is controller action:</p>
  
  <pre><code>    public function actionDisplayMessage(){ 
  $q = $_POST['bcfield'];
  $model=ScriptQuestion::model()-&gt;findAll();  
  $sql = "SELECT name  FROM crm_field WHERE crm_field_id=". $q ;
      $command = Yii::app()-&gt;db-&gt;createCommand($sql);
      $result= $command-&gt;queryScalar(); 
      echo "%".$result."%";
      $this-&gt;performAjaxValidation($model);       
      }
  </code></pre>