Do you have more than one DataPage deployed on the same web page by any chance ? If yes then you will need to give the DataPage you have the calculation on an ID. To do so, add Header/Footer. Disable text editor for both   Header: <div id="mypage"> Footer: </div>   Then change this line of the code: document.getElementById("caspioform").onsubmit=calculate;   to   document.getElementById("mypage").onsubmit=calculate;