• 0
mdav20

Calculate on report details page

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.

Share this post


Link to post
Share on other sites

1 answer to this question

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now