Skip to content

Commit f04e3d6

Browse files
committed
wip(web): collapse gate name fields into single full name input
1 parent 2d893d5 commit f04e3d6

3 files changed

Lines changed: 11 additions & 35 deletions

File tree

‎web/layouts/partials/pricing-gate.html‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,10 @@
99
<h3>Access the pricing calculator</h3>
1010
<p class="gate-lead">Enter your email to build your estimate.</p>
1111
<form id="pricing-gate-form" novalidate>
12-
<div class="gate-field-row">
13-
<div class="gate-field">
14-
<label for="gate-firstname">First name <span class="req">*</span></label>
15-
<input id="gate-firstname" name="firstname" type="text" required
16-
autocomplete="given-name" placeholder="Ada">
17-
</div>
18-
<div class="gate-field">
19-
<label for="gate-lastname">Last name <span class="req">*</span></label>
20-
<input id="gate-lastname" name="lastname" type="text" required
21-
autocomplete="family-name" placeholder="Lovelace">
22-
</div>
12+
<div class="gate-field">
13+
<label for="gate-fullname">Full name <span class="req">*</span></label>
14+
<input id="gate-fullname" name="fullname" type="text" required
15+
autocomplete="name" placeholder="Your full name">
2316
</div>
2417
<div class="gate-field">
2518
<label for="gate-email">Work email <span class="req">*</span></label>

‎web/static/css/pricing-gate.css‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@
5454
font-size: .95rem;
5555
}
5656

57-
#epc #pricing-gate .gate-field-row {
58-
display: flex;
59-
gap: 12px;
60-
}
61-
62-
#epc #pricing-gate .gate-field-row .gate-field {
63-
flex: 1;
64-
min-width: 0;
65-
}
66-
6757
#epc #pricing-gate .gate-field {
6858
text-align: left;
6959
margin-bottom: 16px;

‎web/static/js/pricing-gate.js‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@
7575
var heroActions = document.querySelector('.hero-actions');
7676
if (heroActions) heroActions.hidden = true;
7777

78-
var firstNameInput = document.getElementById('gate-firstname');
79-
var lastNameInput = document.getElementById('gate-lastname');
78+
var fullNameInput = document.getElementById('gate-fullname');
8079
var emailInput = document.getElementById('gate-email');
8180
var form = document.getElementById('pricing-gate-form');
8281
var consentInput = document.getElementById('gate-consent');
@@ -92,17 +91,11 @@
9291
ev.preventDefault();
9392
errorEl.hidden = true;
9493

95-
var firstName = (firstNameInput.value || '').trim();
96-
var lastName = (lastNameInput.value || '').trim();
94+
var fullName = (fullNameInput.value || '').trim();
9795
var email = (emailInput.value || '').trim();
98-
if (!firstName) {
99-
showError('Please enter your first name.');
100-
firstNameInput.focus();
101-
return;
102-
}
103-
if (!lastName) {
104-
showError('Please enter your last name.');
105-
lastNameInput.focus();
96+
if (!fullName) {
97+
showError('Please enter your full name.');
98+
fullNameInput.focus();
10699
return;
107100
}
108101
if (!EMAIL_RE.test(email)) {
@@ -120,8 +113,8 @@
120113
var consentText = document.getElementById('gate-consent-text').textContent.replace(/\s+/g, ' ').trim();
121114
var payload = {
122115
fields: [
123-
{ objectTypeId: '0-1', name: 'firstname', value: firstName },
124-
{ objectTypeId: '0-1', name: 'lastname', value: lastName },
116+
// the form's renamed "Full name" field still maps to firstname
117+
{ objectTypeId: '0-1', name: 'firstname', value: fullName },
125118
{ objectTypeId: '0-1', name: 'email', value: email }
126119
],
127120
context: {

0 commit comments

Comments
 (0)