Hi I just want to ask, I am getting the sum from the two of my textfields,but unfortunately it did not save to my table in column amount.can you help me why is not saving please.
Thank you in advance.
payment.php //this is my model extends CActiverecords
protected function afterSave(){
parent::afterSave();
$this->amount = $->txt1 + $this->txt2;
}
Now the amount is automatically computed when clicking the save button…I have no amount textfield in my form.
Maybe I am wrong in using the afterSave(); my understanding for this is when all the data is finished inserted the afterSave will be invoke and I can do insertion again in other column that what I want.