Jump to content

Inserting a calculated field


Recommended Posts

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;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...
  • 7 years later...

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 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...