Copy link to clipboard
Copied
I have a web page where users submit a form and info is sent to a 3rd party vendor.
The issue I have is that it takes a few seconds for the process to complete and my users are hitting the submit button multiple times.
and its causing issues with multiple submissions to the 3rd party vendor.
QUESTION:
Is there a way to send the user to the next page as soon as they hit the submit button while the code processing takes place?
So they cant hit the submit button more than once
Like this
You could handle this a couple of ways. The more "traditional" way, I guess, is to disable the submit button via JS immediately after you trigger the long-running action. You'd probably have to do both with JS.
An alternative approach like what you're suggesting would involve the submission going to the next page immediately, then within that next page you could use CFTHREAD to process the long-running work separately, while presenting a message to the user that the work was in progress. So the n
...Copy link to clipboard
Copied
You could handle this a couple of ways. The more "traditional" way, I guess, is to disable the submit button via JS immediately after you trigger the long-running action. You'd probably have to do both with JS.
An alternative approach like what you're suggesting would involve the submission going to the next page immediately, then within that next page you could use CFTHREAD to process the long-running work separately, while presenting a message to the user that the work was in progress. So the next page would load a lot faster as a result, but you'd have to figure out how you want to handle the callback from the long-running work.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
Both of Dave's suggestions are the most common methods of preventing multiple form submits. One of my favourite ways is to hide the submit button on submit and display in its place a spinning gif to indicate to the user that the process is working in the background.
V/r,
^ _ ^