Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: PERFORMING CALCULATIONS ON DYNAMIC TABLE ROWS (Read 813 times) previous topic - next topic

PERFORMING CALCULATIONS ON DYNAMIC TABLE ROWS

Dear Sir @willvin I appreciate your help. If possible  please  help me about this issue . While I was using static table the following code was working perfectly to multiply two values i-e rate & quantity and result was displayed on third field invoice_rate .  But after using Dynamic Table Row it is not working. Thanks & Regards...

Code: [Select]
$(document).ready(function() { $("#ctrl-rate,#ctrl-quantity").keyup(function () { $('#ctrl-invoice_rate').val(($('#ctrl-quantity').val() * $('#ctrl-rate').val())); }); }); 

Re: PERFORMING CALCULATIONS ON DYNAMIC TABLE ROWS

Reply #1
@maumar‍ that is because you are using the wrong field id, since you changed it to Dynamic Table Row the id of the field is different. The id would be in #ctrl-rate-row1, #ctrl-quantity-row1, #ctrl-rate-row2, #ctrl-quantity-row2, etc. The best solution is for you to do your calculation with PHP in Page Events before it is inserted into the database, or you change back to the single form.