DesiLogi Posted October 19, 2015 Report Share Posted October 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
DesiLogi Posted October 19, 2015 Author Report Share Posted October 19, 2015 Basically, if we can get to whatever the Submit code is and run it along with some other javascript so that, upon Submit, the datapage both a) shows a 'successful submission' message and reloads the datapage form below it so the user can continue to enter records. Quote Link to comment Share on other sites More sharing options...
Aurora Posted October 21, 2015 Report Share Posted October 21, 2015 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 Quote Link to comment Share on other sites More sharing options...
DesiLogi Posted October 27, 2015 Author Report Share Posted October 27, 2015 Hi Aurora, That works great- thanks so much! Aurora 1 Quote Link to comment Share on other sites More sharing options...
Hastur Posted February 19, 2020 Report Share Posted February 19, 2020 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> Quote Link to comment Share on other sites More sharing options...
DesiLogi Posted February 19, 2020 Author Report Share Posted February 19, 2020 Excellent- thanks Hastur! Quote Link to comment Share on other sites More sharing options...
RonAnderson Posted November 7, 2022 Report Share Posted November 7, 2022 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 Quote Link to comment Share on other sites More sharing options...
autonumber Posted November 11, 2022 Report Share Posted November 11, 2022 Hi @RonAnderson - could you try the script below? You can set the 'Destination after record submit:' to display a message > disable HTML editor and paste this code: Your submission was successful. <script> setTimeout(function () { window.location.href = "DataPageURL"; }, 2000); </script> 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.