Chakkra Posted October 6, 2018 Report Share Posted October 6, 2018 I want to achieve this simple calculation (below) in my details page. This is where the user enters new lab_fee and the update should take place for the value of TotalFee. It should automaticcally display the value before i hit the Update button on the details page. .... var v1 = document.getElementById("EditRecordlab_fee").value; var v2 = document.getElementById("EditRecordc_discount").value; var v3 = document.getElementById("EditRecordcredit_charge").value; var v4 = v2 + v3 - v1; document.getElementById("EditRecordTotalFee").value = Round(v4,2); .... According to Caspio Bridge 13.0, it was suggested that the below javascript could do the job. i guess for my case i have to put some codes in the //do somethig. Or I might be wrong. Can anyone kindly help me on this? <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { // do something }); </script> Quote Link to comment Share on other sites More sharing options...
MayMusic Posted October 8, 2018 Report Share Posted October 8, 2018 You can try a "calculated value" form element instead of JS. By default, the form element is text, change it to Calculated Value and select the fields you want to use in your calculation: [@field:discount] + [@field:charge] - [@field:lab_fee] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.