How to get excel functions kind of functionality in text fields?
<p>I have a page which looks like below. Where some of the data are from database and there will be form fields also beside database data. All are dynamic so we need to validation for every field also. </p>

<p>Please check this <a href="http://jsbin.com/efinak/22/edit" rel="nofollow">http://jsbin.com/efinak/22/edit</a></p>

<pre><code>Total Spent Cost: ((t1*100+t2*200)*x%+(t3*110)*y%)spent for A + spent for B

Client : A

product        No of Hours      Avg Rate/Hour       Cost
A1                  t1              100             t1*100
A2                  t2              200             t2*200

Total Cost:                                         t1*100+t2*200
Percentage(%):                                          x
Spent Cost:                                         (t1*100+t2*200)*x%

Client : B

product        No of Hours      Avg Rate/Hour       Cost
B1                  t3              110             t3*100


Total Cost:                                         t3*110
Percentage(%):                                        y
Spent Cost:                                         (t3*110)*y%
</code></pre>

<p>In the above example client, product and No of hours will come from database. I kept a text field for Avg Rate/Hour and a text field for Cost also. </p>

<p>Why i mentioned in the question excel kind of funcitonality is i will explain here.
If suppose i set Avg Rate/Hour text field then automatically cost should be calcualted without any redirecting. In the same way if you set cost Avg Rate/ hour should be calculated automatically. </p>

<p>Once costs are calculated Total cost should be calculated automatically.Like above percentage is also having a text field which will also set by user with some value. Based on that you need to calucalte spent cost.</p>

<p>I need to this thing for every cleint. Once after every cleint's spent cost calculated automatically total spent cost also should be calcualted on the fly.</p>

<p>I need ideas and if possible more help.</p>
