NeoInJS Posted June 30, 2016 Report Share Posted June 30, 2016 My Update form has 7 dropdown fields (Q1 – Q7) in which Rate/Yes/No options have corresponding numeric values. (Rate=No - No value, Yes=5, No=0) . We need help in 2 things. 1. Calculate and store the total Value of all the fields.To Calculate and store the total value of the Q1 – Q7 dropdown, we use the following script in the footer of the update form, (but it seems that it's not working) <SCRIPT LANGUAGE="JavaScript"> function calculate() { var Q1 = parseInt(document.getElementById("EditRecordQ1").value); var Q2 = parseInt(document.getElementById("EditRecordQ2").value); var Q3 = parseInt(document.getElementById("EditRecordQ3").value); var Q4 = parseInt(document.getElementById("EditRecordQ4").value); var Q5 = parseInt(document.getElementById("EditRecordQ5").value); var Q6 = parseInt(document.getElementById("EditRecordQ6").value); var Q7 = parseInt(document.getElementById("EditRecordQ7").value); QRating=parseInt( Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7); document.getElementById("EditRecordReferral_Rating").value = QRating; } document.getElementById("caspio").onsubmit=calculate; </SCRIPT> 2. Calculate and store get the Percentage of the answered questions. --> Need help on this. Our URL https://c2arw288.caspio.com/dp.asp?AppKey=DA284000754da7037a634519be3d&bestemailID=cmedrano@orangetheoryfitness.com Thank you in advance. Quote Link to comment Share on other sites More sharing options...
JayMont Posted June 30, 2016 Report Share Posted June 30, 2016 Hi! On your first question. Can you try changing the last line to: document.getElementById("caspio").onsubmit=calculate(); Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 30, 2016 Report Share Posted June 30, 2016 The last line should be document.getElementById("caspioform").onsubmit=calculate; Also you need to make sure you do not have any blank value. In first dropdown you have Rate which is blank for value. Make sure to make all dropdowns required so they have to choose a value Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 30, 2016 Report Share Posted June 30, 2016 Did that help? Quote Link to comment Share on other sites More sharing options...
NeoInJS Posted July 1, 2016 Author Report Share Posted July 1, 2016 This worked.. Thank you MayMusic! Quote Link to comment Share on other sites More sharing options...
MayMusic Posted July 1, 2016 Report Share Posted July 1, 2016 You are welcome! Quote Link to comment Share on other sites More sharing options...
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.