Accessing field value into a table in the same form

Hey everyone,

So the situation i am in is quite simply. I have a field with id as ‘amt’ and also there is a table with fields ‘month’ ,‘amt_paid’ and ‘bal’ in each column of the table. [Note: ‘bal’ is read-only]
Now initially the ‘amt’ is fed with some value. In the table when the user selects the ‘month’ and ‘amt_paid’ , i want the ‘bal’ field for that row to calculate ‘amt’ - ‘amt_paid’ automatically. I have been trying really hard to write a custom script for this but without success. Even the wiki doesn’t provide sufficient explanation to help me understand this.
Can anyone help me with this script?

Many thanks,

is the amt field in the table or outside the table ?

Its outside the table. But all belong to the same form.

Custom script will be executed in client side (js) or in server side (py)?

i want it to be done in client side (js) . can that be done?

Can you explain with screen shot and your usecase?