Jump to content
  • 0

Submission Displaying Message issue


Elderberg

Question

Upon successful submission I have a message displaying "Your record was successfully updated."   However, for some reason now the submission form is repeated below this after successful submission. 

I notice after the submission the URL has this:  ?appSession=8RB87A2G927E83NL92A4 ...

I'm not sure why this appSession key is appended to the URL but it seems to be causing the issue.  Does anyone have any idea what's going on or tips on where I should start troubleshooting?  I tried to check a few places when I edit the datapage but didnt see anything out of the ordinary.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I've isolated it to the javascript below which I've used successfully in other datapages.  I've stripped away my code and run the form with the below code verbatim.  (i.e. the if statement i changed the condition to be "1") and ran the code and experienced the weird issue.  I'm totally stumped.

 

<script type="text/javascript">
// PREVENT SUBMIT UNLESS VALIDATED
document.addEventListener('BeforeFormSubmit', function(event) {
event.preventDefault();

  // checks validation rules, only submits if all rules are validated successfully.
if (1) {

    document.forms["caspioform"].submit();
 } 
});
</script>

 

Link to comment
Share on other sites

  • 0

For benefit of others, the following code works better:

// PREVENT SUBMIT UNLESS VALIDATED
document.addEventListener('BeforeFormSubmit', function(event) {

  if (some_condition) {
    //result if condition is met
 
  } else {

   event.preventDefault()
  }
});

 

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
Answer this question...

×   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...