Workaround for the issue where using CF7 add confirm and Google Sheets Connector together adds duplicate entries to the spreadsheet

Regarding the Wordpress contact form plugin Contact Form 7,
when using "Contact Form 7 add confirm", the plugin that adds a confirmation screen, and
"CF7 Google Sheets Connector", the plugin that summarizes submission content in a spreadsheet, together,
I will introduce a workaround for the phenomenon where the same content is sent to the spreadsheet twice, once when transitioning to the confirmation screen and once when submitting.
Please note that I haven't found a fundamental solution, and this is merely a temporary workaround.
Table of Contents
Workaround
For the phenomenon where the content is sent twice, once on the confirmation screen and once on submission, we will temporarily give up on a direct fix.
Instead, we will make sure that the button text is entered into the "submit" column only upon submission,

(In this example, row 5 should be used)
By applying a filter to the "submit" column, you can display only the submitted information.

This is the approach we will take.
Steps
There's no particular need to touch the confirmation button:
<input type="submit" value="Confirm">
The goal is to set some `name` attribute for the submit button.
<input type="submit" name="submit" value="Submit">
First, assign an ID or class to the submit button from the Contact Form 7 editing screen.
[submit id:submit "Submit"]
It will look like this:

This will output as follows:
<input type="submit" id="submit" value="Submit">
Then, set the `name` attribute of the submit button using JS.
$("#submit").attr("name", "submit"); // Set the name attribute of the submit button to 'submit'
/* == or == */
document.getElementById("submit").setAttribute("name", "submit"); // If using vanilla JavaScript, it would be like this
With this, the "submit" information will only be sent upon actual submission.
Next, create a "submit" column in the spreadsheet (match it with the name attribute).

The information will be entered like this:

Finally, apply a filter to the "submit" column.

What was happening
When "Contact Form 7 add confirm" and "CF7 Google Sheets Connector" are used together,
at the timing of transitioning to the confirmation screen,

and at the timing of submission, information is sent to the spreadsheet,

resulting in the same information being sent twice to the spreadsheet.

It would be a nightmare if users repeatedly went back and forth between the confirmation screen...
It's not certain, but it seems that according to the specifications of "CF7 Google Sheets Connector", information is sent to the spreadsheet when a button with type="submit" is pressed,
I believe it's sent twice because both the button to transition to the confirmation screen and the submit button are of type="submit".




If this was helpful, we'd appreciate your support!
All support received will be used for childcare.
Author's Baby Registry (Amazon)
Send support via OFUSE
Alternatively, support me by buying something through the buttons below
(You don't have to buy the specific product at the link.)
Support me via Amazon
Support me via Rakuten
Support me via Yahoo!Shopping
PR