Jump to content
  • 0

Calculate on report details page


mdav20

Question

I'm trying to calculate the number of hrs on a report details page.  Its simply (hrs_removed - hrs_installed) nothing fancy.

 

Here is the code I'm trying to use in the footer of my report details page.

 

<SCRIPT LANGUAGE="JavaScript">

 function calculate()
 {
var v_field1 = parseFloat(document.getElementById ("EditRecordhrs_removed").value);
if (isNaN(v_field1)) v_field1 = 0;
var v_field2 = parseFloat(document.getElementById ("EditRecordhrs_installed").value);
if (isNaN(v_field2)) v_field2 = 0;
var v_total = (v_field1 - v_field2);
document.getElementById("EditRecordhrs_total").value = (v_total);
}

document.getElementById("caspioform").onchange=calculate;

</SCRIPT>

Trying to get it populate the hrs_total field after putting in the hrs_removed and hrs_installed and before submitting the form.

Link to comment
Share on other sites

2 answers to this question

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.

Guest
Answer this question...

×   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...
×
×
  • Create New...