|
75 | 75 | var heroActions = document.querySelector('.hero-actions'); |
76 | 76 | if (heroActions) heroActions.hidden = true; |
77 | 77 |
|
78 | | - var firstNameInput = document.getElementById('gate-firstname'); |
79 | | - var lastNameInput = document.getElementById('gate-lastname'); |
| 78 | + var fullNameInput = document.getElementById('gate-fullname'); |
80 | 79 | var emailInput = document.getElementById('gate-email'); |
81 | 80 | var form = document.getElementById('pricing-gate-form'); |
82 | 81 | var consentInput = document.getElementById('gate-consent'); |
|
92 | 91 | ev.preventDefault(); |
93 | 92 | errorEl.hidden = true; |
94 | 93 |
|
95 | | - var firstName = (firstNameInput.value || '').trim(); |
96 | | - var lastName = (lastNameInput.value || '').trim(); |
| 94 | + var fullName = (fullNameInput.value || '').trim(); |
97 | 95 | 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(); |
106 | 99 | return; |
107 | 100 | } |
108 | 101 | if (!EMAIL_RE.test(email)) { |
|
120 | 113 | var consentText = document.getElementById('gate-consent-text').textContent.replace(/\s+/g, ' ').trim(); |
121 | 114 | var payload = { |
122 | 115 | 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 }, |
125 | 118 | { objectTypeId: '0-1', name: 'email', value: email } |
126 | 119 | ], |
127 | 120 | context: { |
|
0 commit comments