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">
|
||||
<p class="section-kicker">Bring Your Business</p>
|
||||
<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">
|
||||
<div class="biz-field">
|
||||
<label for="bizDescription">Business Description</label>
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user