G
Godfrey Sorita
Guest
Hi Sudhakar, You can use Rollbase client-side APIs to compute the total dynamically. For example, you have 'num1', 'num2', 'num3' and 'sumField' integer fields on your form. To compute the sum, paste the code below on a script component on your form's page editor: script function computeSum() { var num1 = rbf_getFieldValue('num1'), num2 = rbf_getFieldValue('num2'), num3 = rbf_getFieldValue('num3'), sum = parseInt(num1) + parseInt(num2) + parseInt(num3); rbf_setFieldValue('sumField', sum); } /script Then, add the computeSum() function to the onchange events of 'num1', 'num2' and 'num3' fields. This will compute for the total when any of the three fields are changed. Please see Chapter 7 of Rollbase in Action . Regards, Godfrey
Continue reading...
Continue reading...