Hi
I designed a website to collect user’s input and submit to a google form by corvid and i-frame.
But somehow some data will duplicate or re-submit to google form, and that is a problem to me. I attached part of my code as follow, hope someone can help.
There’s a first page to collecting user’s input. When user click submit button, data will be keep in session by wix-storage api and jump to a thanks page.
code like this:
var param = encodeURIComponent(“some-string-data”);
local.setItem(“url”, “google-form-url”);
local.setItem(“param”, param);
wixLocation.to(“/thanks”);
In thanks page, there’s a button for user to double check whether to submit. After user click the button, data will be post to i-frame. Then i-frame will submit data to google form and show thanks message of google form.
thanks page code like this:
export function submit_button_click(event) {
$w(“#iframe”).postMessage(local.getItem(“url”)+“|”+local.getItem(“param”));
local.removeItem(“url”);
local.removeItem(“param”);
}
i-frame java script like this: