From 840982dc2ec8200e9f51894beb47d5c2fced2336 Mon Sep 17 00:00:00 2001 From: Reef Date: Thu, 20 Aug 2026 21:16:12 +0000 Subject: [PATCH] fix: silent fetch POST instead of new-window form, update subtitle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace hidden form POST (target='_blank') with silent fetch() that ignores the response — no new window opens - Send boolean values directly instead of serializing to 'true'/'false' strings - Update subtitle: 'Download your PDF in minutes.' -> 'We will send the report in minutes.' --- index.html | 2 +- script.js | 41 ++++++++++++++--------------------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index a74685c..df18d75 100644 --- a/index.html +++ b/index.html @@ -397,7 +397,7 @@

Bring Your Business

Your Personalized Odoo Project Plan

-

Tell us about your business. AI prepares a custom project plan with recommended modules, timeline, and roadmap. Download your PDF in minutes.

+

Tell us about your business. AI prepares a custom project plan with recommended modules, timeline, and roadmap. We will send the report in minutes.

diff --git a/script.js b/script.js index efa403a..bf4f299 100644 --- a/script.js +++ b/script.js @@ -602,33 +602,20 @@ var si = 0, submitBtn.textContent = 'Generating...'; submitBtn.disabled = true; - /* Create a hidden form to POST to the webhook and open response in new window */ - var f = document.createElement('form'); - f.method = 'POST'; - f.action = 'https://n8n.odoo4projects.com/webhook/bring-your-business'; - f.target = '_blank'; - f.style.display = 'none'; - - var fields = { - email: email, - description: description, - goals: goals, - challenges: challenges, - has_homepage: hasHomepage ? 'true' : 'false', - uses_odoo: usesOdoo ? 'true' : 'false', - has_developer: hasDeveloper ? 'true' : 'false' - }; - for (var key in fields) { - var inp = document.createElement('input'); - inp.type = 'hidden'; - inp.name = key; - inp.value = fields[key]; - f.appendChild(inp); - } - - document.body.appendChild(f); - f.submit(); - f.remove(); + /* POST silently to webhook — the report will be emailed */ + fetch('https://n8n.odoo4projects.com/webhook/bring-your-business', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + email: email, + description: description, + goals: goals, + challenges: challenges, + has_homepage: hasHomepage, + uses_odoo: usesOdoo, + has_developer: hasDeveloper + }) + }).catch(function () { /* ignore */ }); /* Show success message — we'll email the report */ form.style.display = 'none';