Public Access
fix: silent fetch POST instead of new-window form, update subtitle
- 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.'
This commit is contained in:
+1
-1
@@ -397,7 +397,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="section-kicker">Bring Your Business</p>
|
<p class="section-kicker">Bring Your Business</p>
|
||||||
<h2>Your Personalized Odoo Project Plan</h2>
|
<h2>Your Personalized Odoo Project Plan</h2>
|
||||||
<p class="biz-sub">Tell us about your business. AI prepares a custom project plan with recommended modules, timeline, and roadmap. Download your PDF in minutes.</p>
|
<p class="biz-sub">Tell us about your business. AI prepares a custom project plan with recommended modules, timeline, and roadmap. We will send the report in minutes.</p>
|
||||||
<form class="biz-form" id="bizForm">
|
<form class="biz-form" id="bizForm">
|
||||||
<div class="biz-field">
|
<div class="biz-field">
|
||||||
<label for="bizDescription">Business Description</label>
|
<label for="bizDescription">Business Description</label>
|
||||||
|
|||||||
@@ -602,33 +602,20 @@ var si = 0,
|
|||||||
submitBtn.textContent = 'Generating...';
|
submitBtn.textContent = 'Generating...';
|
||||||
submitBtn.disabled = true;
|
submitBtn.disabled = true;
|
||||||
|
|
||||||
/* Create a hidden form to POST to the webhook and open response in new window */
|
/* POST silently to webhook — the report will be emailed */
|
||||||
var f = document.createElement('form');
|
fetch('https://n8n.odoo4projects.com/webhook/bring-your-business', {
|
||||||
f.method = 'POST';
|
method: 'POST',
|
||||||
f.action = 'https://n8n.odoo4projects.com/webhook/bring-your-business';
|
headers: { 'Content-Type': 'application/json' },
|
||||||
f.target = '_blank';
|
body: JSON.stringify({
|
||||||
f.style.display = 'none';
|
email: email,
|
||||||
|
description: description,
|
||||||
var fields = {
|
goals: goals,
|
||||||
email: email,
|
challenges: challenges,
|
||||||
description: description,
|
has_homepage: hasHomepage,
|
||||||
goals: goals,
|
uses_odoo: usesOdoo,
|
||||||
challenges: challenges,
|
has_developer: hasDeveloper
|
||||||
has_homepage: hasHomepage ? 'true' : 'false',
|
})
|
||||||
uses_odoo: usesOdoo ? 'true' : 'false',
|
}).catch(function () { /* ignore */ });
|
||||||
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();
|
|
||||||
|
|
||||||
/* Show success message — we'll email the report */
|
/* Show success message — we'll email the report */
|
||||||
form.style.display = 'none';
|
form.style.display = 'none';
|
||||||
|
|||||||
Reference in New Issue
Block a user