I'm having trouble with a script. I understand that I can add to the footer of a submission DP a script that should take two "user" inputted values (Tool_Retail_Value and Tool_Sug_Rental_Rate) and perform a calculation using them and then take the result and put it back into the table into a third field (Tool_Daily_Rate).
So what's wrong?
function calculate()
{
  var rval = document.getElementById("InsertRecordTool_Retail_Value").value);
  var rrate = document.getElementById("InsertRecordTool_Sug_Rental_Rate").value);
  var drate = Math.abs(rval * rrate);
  document.getElementById("InsertRecordTool_Daily_Rate").value=drate;
}
/* On submitting the webform, the function calculate is executed */
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.
Question
EBickmann
I'm having trouble with a script. I understand that I can add to the footer of a submission DP a script that should take two "user" inputted values (Tool_Retail_Value and Tool_Sug_Rental_Rate) and perform a calculation using them and then take the result and put it back into the table into a third field (Tool_Daily_Rate).
So what's wrong?
function calculate()
{
  var rval = document.getElementById("InsertRecordTool_Retail_Value").value);
  var rrate = document.getElementById("InsertRecordTool_Sug_Rental_Rate").value);
  var drate = Math.abs(rval * rrate);
  document.getElementById("InsertRecordTool_Daily_Rate").value=drate;
}
/* On submitting the webform, the function calculate is executed */
document.getElementById("caspioform").onsubmit=calculate;
Link to comment
Share on other sites
5 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.