Jump to content

OnSubmit Script Runs when Delete Button Clicked


Recommended Posts

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;

 

Link to comment
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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...