I am trying to auto submit a form on WIX without any user interaction. I have tried this below but I am getting this error below. If I just manually hit submit it works just fine. Any ideas?
code: ‘VALIDATION_FAILED’, message: “Validation failed: submission doesn’t satisfy form requirements.”
const query = wixLocationFrontend.query;
$w("#form").setFieldValues({
cf_utm_campaign: decodeURIComponent(query.utm_campaign),
cf_utm_content: decodeURIComponent(query.utm_content),
cf_utm_medium: decodeURIComponent(query.utm_medium),
cf_utm_source: decodeURIComponent(query.utm_source),
});
console.log("Campaign:", decodeURIComponent(query.utm_campaign));
console.log("Content:", decodeURIComponent(query.utm_content));
console.log("Medium:", decodeURIComponent(query.utm_medium));
console.log("Source:", decodeURIComponent(query.utm_source));
$w("#form").submit();
Hi Graham, It's hard to know without taking a look at the site itself. Are the fields visually populated after this code runs? Are these all the fields in the form? Best,
Eitan