joscetre Posted August 11, 2017 Report Share Posted August 11, 2017 I have a tabular report with a details page. The details page has a script that runs when the form is submitted via Caspio's Update button (using 'onsubmit'). The details page also includes Caspio's Back button. The problem I have is that the script runs when either the Update button OR the Back button is clicked. I would have thought the 'onsubmit' script should only fire when the Update button is pressed. Am I missing something? Here is the code: function CheckSubmit() { alert("running the OnSubmit script!"); } document.getElementById("caspioform").onsubmit=CheckSubmit; Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted August 15, 2017 Report Share Posted August 15, 2017 On 8/12/2017 at 1:30 AM, joscetre said: I have a tabular report with a details page. The details page has a script that runs when the form is submitted via Caspio's Update button (using 'onsubmit'). The details page also includes Caspio's Back button. The problem I have is that the script runs when either the Update button OR the Back button is clicked. I would have thought the 'onsubmit' script should only fire when the Update button is pressed. Am I missing something? Here is the code: function CheckSubmit() { alert("running the OnSubmit script!"); } document.getElementById("caspioform").onsubmit=CheckSubmit; Hello joscetre, I would suggest replacing triggered event to the following one: document.getElementById("Mod0EditRecord").onclick=CheckSubmit; Hope this helps. Quote Link to comment Share on other sites More sharing options...
joscetre Posted August 15, 2017 Author Report Share Posted August 15, 2017 Yes, that works, thank you. 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.