title: Yii framework....Calculate total on fly
body: <p>I'm newbie in Yii framework and start learning on small web project so I got stuck on this position as how to solve it.</p>
  
  <p>I have a 'Order_form'  where a user has confirm his order and if want to change the 'Qty' so only this can change then bydoing this I need to change the Total value to be calculate on fly on same form if Qty got changed by user.</p>
  
  <p></p>
  
  beginWidget('CActiveForm', array(
      'id'=>'order-form',
      'enableAjaxValidation'=>false,
  )); ?>
  
  <pre><code>&lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'price'); ?&gt;
          &lt;?php echo $model-&gt;price; ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'qty'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'qty'); ?&gt;
          &lt;?php echo $form-&gt;error($model,'qty'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'total'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'total'); ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>endWidget(); ?>
  </p>
  
  <p>
  $(document).ready(function() {
      var myVar = '999';
      $("#model_total").val(myVar);
  });
  '</p>
  
  <p>Here I updated my script to clarify what I need, so here I'm trying to pass a value of '999' to 'Total' on the same form but this doesn't work.  It might be that I'm missing/doing something wrong.</p>
  
  <p>I would also like other way to calculate Qty x Price and get the result from the controller if this is possible if so please guide through code.</p>