Barry Posted November 23, 2023 Report Share Posted November 23, 2023 Hello, I have a submission DataPage with some calculated fields that require some time to finish the calculation and I need a way to set a delay of about 30 seconds after the user clicks the submit button. I found something similar in a tech tip from Caspio to set a timeout to the form but that's not exactly what I want to achieve. Can anyone help me with this please? Quote Link to comment Share on other sites More sharing options...
deemuss Posted November 23, 2023 Report Share Posted November 23, 2023 Hi @Barry Although there is no standard way to do this in Caspio, a simple JavaScript could do the job: window.addEventListener('load', function () { // Get all elements with IDs starting with "Submit_" var submitElements = document.querySelectorAll('[id^="Submit_"]'); // Disable each element for 30 seconds submitElements.forEach(function (element) { element.disabled = true; }); // Enable elements after 30 seconds setTimeout(function () { submitElements.forEach(function (element) { element.disabled = false; }); }, 30000); // 30 seconds in milliseconds }); You can see comments so that you can adjust each part to your needs. Also, I have attached a sample app where I applied the code. However, my solution may not be perfect since the button looks active, it just allows the submission after the time interval. If you need it to be 'visually' inactive, you may also need to apply some CSS. FORUM_Make_Submit_Button_Inactive_for_First_30_1_0_2023-Nov-23_1014.zip 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.