Hi guys, 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.
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.
beginWidget('CActiveForm', array( 'id'=>'order-form', 'enableAjaxValidation'=>false, )); ?>
<div class="row">
<?php echo $form->labelEx($model,'price'); ?>
<?php echo $model->price; ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'qty'); ?>
<?php echo $form->textField($model,'qty'); ?>
<?php echo $form->error($model,'qty'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'total'); ?>
<?php echo $form->textField($model,'total'); ?>
</div>
endWidget(); ?>
$(document).ready(function() { var myVar = '999'; $("#model_total").val(myVar); }); '
Here i updated my script to clarify more what I need, so here I'm trying to pass '999' value to 'Total' on same form but this doesnt work might be Im missing/doing some thing wrong.
I would also like other way to calculate Qty x Price and get the result from controller if this is possible if so please guide through code.
I hope to understand my question and look forward to hear from you guys soon.
Thanks in advance for your attention.
Khan