mark048 Posted August 11, 2010 Report Share Posted August 11, 2010 I had a code to automatically submit a page without the user clicking "Submit." I cannot find the code anymore. Does anyone have this code? Thanks, Mark Quote Link to comment Share on other sites More sharing options...
0 Barbara Posted August 11, 2010 Report Share Posted August 11, 2010 Hi Mark, Here is a code sample to autosubmit a form. <script> function f_submit() { document.getElementById("caspioform").submit(); } window.onload = f_submit; </script> Cheers, Barbara Quote Link to comment Share on other sites More sharing options...
0 mark048 Posted August 13, 2010 Author Report Share Posted August 13, 2010 That worked. Thanks! Mark Quote Link to comment Share on other sites More sharing options...
0 dbaratz Posted August 31, 2010 Report Share Posted August 31, 2010 how do you impliment this code? Quote Link to comment Share on other sites More sharing options...
0 bahar_vm Posted September 2, 2010 Report Share Posted September 2, 2010 You can place the code inside an HTML block on the DataPage. Best, Bahar M. Quote Link to comment Share on other sites More sharing options...
0 jlwilliford Posted October 14, 2010 Report Share Posted October 14, 2010 This works well for me, unless I have a problem (e.g., unique constraint violation). Then I get an endless loop that requires the user to stop or close the window, losing context. Can something be added to the script to check for a caspio error to break the loop? Quote Link to comment Share on other sites More sharing options...
0 ChrisJ Posted November 3, 2010 Report Share Posted November 3, 2010 Hello jlwilliford, Created simple JavaScript that may satisfy your needs. pre-requisites: - In Styles the class "cbFormError" should be set (non empty). This could be check under: Styles >> Edit Style >> Click "Show Advanced options" on 1st wizard step >> Forms/Details (3rd wizard step) >> Errors and Messages >> "Source" tab - Your Web Form do not results with ending message (step "Destination and Triggers" when editing DataPage; radio option selected other than "Display this message") 1) In the header of your WebForm paste modified script 2) In the footer you paste the checking for errors on page: I did not test all the browsers, but think it should work as there are common JavaScript functions used. Please tell if this helped. Quote Link to comment Share on other sites More sharing options...
0 ChrisJ Posted February 26, 2011 Report Share Posted February 26, 2011 The above described code was not working in case DataPage is deployed using embedded deploy code. I have modified JavaScript of footer (IsError function) in order to be working in embedded DataPage. Quote Link to comment Share on other sites More sharing options...
0 FMorgas Posted March 2, 2011 Report Share Posted March 2, 2011 Hi, in autosubmit formula, i have one big problem, i can not close de page, after autosubmit and his doing submit after submit until the user decides close your browser I make the folow code: <script> function f_submit() { document.getElementById("caspioform").submit(); } window.onload = f_submit; </script> <script language="javascript"> <!-- setTimeout("self.close();",700) --> </script> But dont work in all browsers thnks Quote Link to comment Share on other sites More sharing options...
0 FMorgas Posted March 2, 2011 Report Share Posted March 2, 2011 Done, after autosubmit, because is not close page in all broswer, i put this code. <script> function f_submit() { document.getElementById("caspioform").submit(); } window.onload = f_submit; </script> <script type="text/javascript"> <!-- function redirect(){ window.location = "../test.html" } --> </script> <script language="javascript"> <!-- setTimeout("redirect();",700) --> </script> Im redirect for another page, and his make just one submit... Thanks Quote Link to comment Share on other sites More sharing options...
0 BjornSkifs Posted May 9, 2012 Report Share Posted May 9, 2012 This code works for me in IE <script> function f_submit() { document.getElementById("caspioform").submit(); } window.onload = f_submit; </script> but in Firefox it loops over and over. (I put it in the footer in the destination form). I tried the above suggestions, but I couldn't get them to work. I would be really grateful if you have any suggestions as to how I could solve this. Thank you Bjorn Quote Link to comment Share on other sites More sharing options...
0 BjornSkifs Posted May 10, 2012 Report Share Posted May 10, 2012 I found a solution. I redirect to the form from another form through a querystring. In the querystring I defined a variable that I then used in an if statement as below: <script> function f_submit() { document.getElementById("caspioform").submit(); } if('[@ItemID]' !='') { window.onload = f_submit; } else { window.close(); } </script> The window doesn't actually close in Firefox either, but that's OK. Quote Link to comment Share on other sites More sharing options...
0 MarkMayhrai Posted May 10, 2023 Report Share Posted May 10, 2023 Is it possible to auto submit whenever a value changes? Quote Link to comment Share on other sites More sharing options...
0 PotatoMato Posted May 11, 2023 Report Share Posted May 11, 2023 Hi @MarkMayhrai, you can check this other forum post: -Potato Quote Link to comment Share on other sites More sharing options...
Question
mark048
I had a code to automatically submit a page without the user clicking "Submit." I cannot find the code anymore. Does anyone have this code?
Thanks,
Mark
Link to comment
Share on other sites
13 answers to this question
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.