CoffeeLover Posted November 4, 2021 Report Share Posted November 4, 2021 Hi All, I am currently using the below code to automatically submit a submission form datapage. <script type="text/javascript"> setTimeout('document.getElementById("caspioform").submit()',1);</script> The data is a phone number received via a parameter and it needs to be unique. This code works fine if the field is unique but if the field is not unique it keeps trying to automatically submit the form over and over. How can I run auto submit but only once? Kind regards CoffeeLover Quote Link to comment Share on other sites More sharing options...
0 KlisaN137 Posted November 5, 2021 Report Share Posted November 5, 2021 Hi @CoffeeLover, You can use the following code to check if there is an error prior to submit, and submit only if there are no errors: <script type="text/javascript"> const error = document.querySelector('div[data-cb-name="HeaderErrorMsg"]'); if(!error){ setTimeout('document.getElementById("caspioform").submit()',1); } </script> CoffeeLover 1 Quote Link to comment Share on other sites More sharing options...
0 CoffeeLover Posted November 6, 2021 Author Report Share Posted November 6, 2021 Hi @KlisaN137, Thank you very much for that code it works perfectly with my work flow. Kind regards CoffeeLover Quote Link to comment Share on other sites More sharing options...
Question
CoffeeLover
Hi All,
I am currently using the below code to automatically submit a submission form datapage.
<script type="text/javascript"> setTimeout('document.getElementById("caspioform").submit()',1);</script>
The data is a phone number received via a parameter and it needs to be unique.
This code works fine if the field is unique but if the field is not unique it keeps trying to automatically submit the form over and over.
How can I run auto submit but only once?
Kind regards
CoffeeLover
Link to comment
Share on other sites
2 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.