joscetre

OnSubmit Script Runs when Delete Button Clicked

3 posts in this topic

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;

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now