mdav20 Posted September 13, 2017 Report Share Posted September 13, 2017 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. Quote Link to comment Share on other sites More sharing options...
0 mdav20 Posted September 13, 2017 Author Report Share Posted September 13, 2017 I figured it out thanks to this by @mayMusic Thanks @MayMusic Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted November 14, 2017 Report Share Posted November 14, 2017 You are welcome Quote Link to comment Share on other sites More sharing options...
Question
mdav20
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.
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.