tmwayne Posted May 2, 2012 Report Share Posted May 2, 2012 I have a calculation that I want to populate a field in a details report page. The field totalappfield is not populating and I've tried dozens of iterations based on examples provided by Caspio. Can anyone see what's wrong? function calculate() { var applicationfee = parseFloat(document.getElementById("EditRecordapplicationfee").value); var numbercoapps = parseFloat(document.getElementById("EditRecordnumbercoapps").value); var totalappfee = (applicationfee * numbercoapps); document.getElementById("EditRecordtotalappfee").value=Math.round(totalappfee); } document.getElementById("caspioform").onsubmit=calculate; Quote Link to comment Share on other sites More sharing options...
casyana Posted May 2, 2012 Report Share Posted May 2, 2012 I have a calculation that I want to populate a field in a details report page. The field totalappfield is not populating and I've tried dozens of iterations based on examples provided by Caspio. Can anyone see what's wrong? function calculate() { var applicationfee = parseFloat(document.getElementById("EditRecordapplicationfee").value); var numbercoapps = parseFloat(document.getElementById("EditRecordnumbercoapps").value); var totalappfee = (applicationfee * numbercoapps); document.getElementById("EditRecordtotalappfee").value=Math.round(totalappfee); } document.getElementById("caspioform").onsubmit=calculate; Script looks good. Make sure that all your field's Ids are correct. You mentioned totalappfield field, but according to the script you are updating totalappfee field. All fields used in calculation have to be Text fields or Hidden, you may not use display only fields in calculations. Quote Link to comment Share on other sites More sharing options...
tmwayne Posted May 2, 2012 Author Report Share Posted May 2, 2012 I made sure the fields are hidden fields. Still no luck. I checked the field names to be certain that they are correct. Other ideas? Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted May 2, 2012 Report Share Posted May 2, 2012 I suggest using Firebug to debug the code. It shows you where errors may occur so you can fix them. Best, Bahar M. Quote Link to comment Share on other sites More sharing options...
Juan43 Posted June 3, 2012 Report Share Posted June 3, 2012 Firebug is definitely helpful in this case Quote Link to comment Share on other sites More sharing options...
cheonsa Posted August 20, 2019 Report Share Posted August 20, 2019 Hi all! Just to give you an update with the current features of Caspio, you can now have Calculated Values in Details DataPage. This feature was released last July 2018. Calculated Values allow you to generate dynamic calculations that automatically update as users interact with your form. Common use cases for this feature are order forms, financial calculators, rate schedules and custom data analysis. The Calculated Value form element is available for various data types and the calculated value will be stored in the table once the form is submitted. Kindly check this link for more information: https://howto.caspio.com/datapages/datapage-components/calculated-values/ I know it's late but hoping that this will help other users for future reference. Cheers! -kristina 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.