-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent double form submission #562
Comments
@fredericalpers Currently, we don't have an optimal solution for this issue, I need two days to investigate and will estimate time with you later. |
@fredericalpers I have some points to confirm with you: -"Some customers reported that multiple identical search profiles were created for the same address" means you are mentioning to "interest form"? -"We do not want to put inline scripts on each form." After researching, I found that, "Double form submission" happened in 2 cases: Case 2: reloading the page But we also found that on the system there is a feature "Check for Duplicates" In case a Form which email field is checked as "Required" and the "Check for Duplicates" checkbox is activated, the case that generates the same data will not exist. duplicate_checkbox.mp4So, we will prevent double form submission in the case 2 address records created: no email but other information is the same. For this issue we also found a solution but we are not sure it is the optimal solution. Please let us know your opinion about that. |
Please go ahead and fix Case 1 first. I think for Case 2 we will need to keep the Success or Error Messages in the view of the customer after sending a form or even better implement a redirect to a "Thank you for your message" page. I would like to fix Case 2 in a separat issue later. Information about Duplicate check
Unfortunately the duplicate check in the plugin will only check for the same E-Mail. This means if someone sends the same form with the same E-Mail it will delete the oldest record. |
@fredericalpers I need 4 days to implement and test for Case 1. |
@fredericalpers I fixed Case 1 (prevent double form submission when clicking the "send" button multiple times). Please look at my video and let me know your opinion. Thanks! submission.mp4 |
Looks good to me! Thank you :) |
This is caused by clicking the "send" button multiple times or reloading the page, each time sending a new request / search profile.
While a clean way of dealing with this issue is to add a nonce and check it in the post handler to detect duplicate requests, this approach is too time consuming for now.
Instead we want to prevent double form submission using JavaScript by disabling further submission once the form is sent. One approach is to mark the form with a class and hook into the submit callback.
The text was updated successfully, but these errors were encountered: