Hi there…
I have the folowing form which I want to use to calculate taux*mtht and put it in mttva with ajax but I don’t know how to do this please help me.
<?php $form=$this->beginWidget(‘CActiveForm’, array(
'id'=>'factureachats-form',
'enableAjaxValidation'=>true,
)); ?>
<div class="row">
<?php echo $form->labelEx($model,'taux'); ?>
<?php echo $form->dropDownList($model,'taux',$taux , array('id' => 'taux',
‘empty’=>’–select–’, ‘onchange’=>‘validate_dropdown()’)); ?>
<?php echo $form->error($model,'taux'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'mtht'); ?>
<?php echo $form->textField($model,'mtht',array('id' => 'mtht')); ?>
<?php echo $form->error($model,'mtht'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'mttva'); ?>
<?php echo $form->textField($model,'mttva',array('id' => 'mttva')); ?>
<?php echo $form->error($model,'mttva'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'mtttc'); ?>
<?php echo $form->textField($model,'mtttc'); ?>
<?php echo $form->error($model,'mtttc'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>