Mylene 0 Posted April 20, 2017 Report Share Posted April 20, 2017 Hi everyone, I need to increment value in one field only if Status is "Approved". Type of the datapage is a submission form. Thanks! Quote Link to post Share on other sites
Mathilda 66 Posted April 20, 2017 Report Share Posted April 20, 2017 Hi, you may use the following script in the footer of the datapage: <SCRIPT LANGUAGE="JavaScript"> function calculate() { var check = document.getElementById("InsertRecordField_name").value; if(check =="Approved"){ var v_increment = parseFloat(document.getElementsByName("cbParamVirtual1")[0].value); document.getElementById("InsertRecordField2").value = v_increment+1; } } document.getElementById("caspioform").onsubmit=calculate; </SCRIPT> You need to use a virtual field to sort values in descending order and get the last submitted value, then increment value and write in a field Mylene 1 Quote Link to post Share on other sites
Mylene 0 Posted April 14, 2018 Author Report Share Posted April 14, 2018 It works! Thank you very much! Quote Link to post Share on other sites
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.