Ask Get Input Value

Haii Guys, i’m very new with yii and stiil confused,

i want to get value of textfield input,

let say i have

field_A = 3

field_B = 2

field_C = field_A + field_B

how i can get field_C value before click save button to insert into our DB,

Thx alot…


I hope you will get value of field_A and field_B in controller… there just add the two values and assign to third DB field problem solved :)

No need of necessary doing everything in view.

Lets say you get these values in the form. and user clicks on the save button.

Now in the controller where you check it is a post request, get rquired data using $model->field_C = $model->field_A + $model->field_B

before you go for $model->save()

Hai Rahul, i mean when user input field_A and field_B, field_C will automatic show the result, and then user click save button to insert into table, i think it can do with ajax, but i dont how to write the code,

can you give me an example plisss…