Jump to content

Submit Form: Show Message With Same Form Setting


Recommended Posts

How do I, on a Submission Form, show a successful submission message when using 'Same Form' for the destination? 

 

I am using for these particular forms the iFrame deployment in a modal. When 'Same Form' is clicked it does not close the modal but flashes the form (submits data) and then stays open. This would be ok if I can at least show a 'successful submission' message so the user knows their data was saved.

 

The problem is that if I use Close Form the modal stays open- I can't close the modal via the Caspio datapage.

Link to comment
Share on other sites

Hi DesiLogi !

 

You can add this script into the Footer of your Submission Form : 

<SCRIPT LANGUAGE="JavaScript">

function myFunction()
{
alert ('Form was submitted')
}
document.getElementById("caspioform").onsubmit = myFunction;

</SCRIPT>

When you click on Submit Button, you will see a small notification message that the form was submitted. 

 

Good luck 

 

Aurora  ;)

Link to comment
Share on other sites

  • 4 years later...

 

On 10/21/2015 at 6:23 PM, Aurora said:

Hi DesiLogi !

 

You can add this script into the Footer of your Submission Form : 


<SCRIPT LANGUAGE="JavaScript">

function myFunction()
{
alert ('Form was submitted')
}
document.getElementById("caspioform").onsubmit = myFunction;

</SCRIPT>

When you click on Submit Button, you will see a small notification message that the form was submitted. 

 

Good luck 

 

Aurora  ;)

 

I have the up to date version of this code which is friendly with AJAX loading of the datapages:

<script type="text/javascript">
function customAlert() {
alert ('Form was submitted');
}
document.addEventListener('BeforeFormSubmit', customAlert);
</script>

 

Link to comment
Share on other sites

  • 2 years later...

I have a similar issue. The problem is if a required field isn't filled the above code generates a message "Form was submitted" and then shows "Some fields are required" making the submit confirmation meaningless. I've tried "AfterFormSubmit" but this doesn't appear to be an event. Is there a way around this?

Thanks in advance

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