Skip to content

Commit f84e2a1

Browse files
Zach LasiukZach Lasiuk
authored andcommitted
improved Signup form
1 parent c6b1c2d commit f84e2a1

File tree

1 file changed

+80
-2
lines changed
  • themes/arm-design-system-hugo-theme/layouts/partials/learning-paths

1 file changed

+80
-2
lines changed

themes/arm-design-system-hugo-theme/layouts/partials/learning-paths/next-steps.html

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@
4747
font-size: 16px;
4848
}
4949

50+
51+
#privacy-information {
52+
margin-left: 16px;
53+
margin-right: 24px;
54+
}
55+
.devprog-privacy-text {
56+
color: var(--arm-light-grey);
57+
}
58+
59+
#nonchina-information {
60+
display: block;
61+
}
62+
#china-information {
63+
display: none;
64+
}
65+
5066
</style>
5167

5268

@@ -272,11 +288,29 @@ <h2 class="modal-title u-margin-right-1/2" style="margin-top: 0px; margin-bottom
272288

273289
<hr class="u-margin-right-1/2">
274290
<div id="marketo-form-container"></div>
291+
<div id="privacy-information">
292+
<p class="devprog-privacy-text">
293+
This data is not linked your email address or name. It is aggregated and reported internally as part of Arm's DEI program
294+
By signing up, you'll receive member news and email updates. You can update your subscription preferences at any time.
295+
</p>
296+
<p id="nonchina-information" class="devprog-privacy-text">
297+
Arm will process your information in accordance with our <a href="https://www.arm.com/company/policies/privacy" target="_blank">Privacy Policy</a>.
298+
</p>
299+
<div id="china-information">
300+
<p class="devprog-privacy-text">
301+
Arm will process your information in accordance with our <a href="https://www.arm.com/company/policies/privacy" target="_blank">Arm</a> and <a href="https://www.armchina.com/privacy" target="_blank">Arm China</a> Privacy Policies.
302+
</p>
303+
<ads-checkbox id="china-checkbox" class="is-small" name="ChinaOK" onclick="chinaCheckboxHandler(this)" tabindex="0">
304+
I consent to have my data transferred outside of China.
305+
</ads-checkbox>
306+
</div>
307+
308+
</p>
309+
</div>
275310
</div>
276311
<div id="form-completed" hidden>
277312
<h2 class="modal-title">Program Registration Success</h2>
278-
<p class="success-message">You're almost there! To complete your membership registration, please click 'confirm membership' in the email we have just sent you.</p>
279-
<p class="success-message">Please check your spam folder if you do not see any email in your inbox within 10 minutes.</p>
313+
<p class="success-message">Thank you for joining the community! Be sure to check your inbox to see if you need to confirm your registration and start enjoying all your member benefits.</p>
280314
</div>
281315
</div>
282316
<div slot="actions" class="u-flex u-flex-direction-column md:u-flex-direction-row u-gap-1" style="justify-content: flex-start;">
@@ -288,6 +322,21 @@ <h2 class="modal-title">Program Registration Success</h2>
288322
</div>
289323
</ads-modal>
290324
<script>
325+
326+
function chinaCheckboxHandler(checkbox) {
327+
checkbox.value().then((value) => {
328+
if (value === true) {
329+
console.log('china checkbox selected. Value: ', value);
330+
document.getElementById('devprog-cta-submit').disabled = false;
331+
}
332+
else {
333+
console.log('china checkbox not selected. Value: ', value);
334+
document.getElementById('devprog-cta-submit').disabled = true;
335+
}
336+
});
337+
338+
}
339+
291340
(() => {
292341
const modal = document.getElementById('modal-custom-trigger');
293342

@@ -301,6 +350,32 @@ <h2 class="modal-title">Program Registration Success</h2>
301350

302351

303352

353+
// Attach China Processing
354+
const countrySelectHandler = () => {
355+
356+
// Handle country select change for dynamic China data processing
357+
const countrySelect = document.getElementById('Country');
358+
if (countrySelect) {
359+
countrySelect.addEventListener('change', function() {
360+
const countryValue = countrySelect.options[countrySelect.selectedIndex].value;
361+
// If country is China, show hidden fields agreeing to data processing
362+
console.log('country select selected. Value: ', countryValue);
363+
if (countryValue === 'China') {
364+
document.getElementById('china-information').style.display = 'block';
365+
document.getElementById('nonchina-information').style.display = 'none';
366+
document.getElementById('devprog-cta-submit').disabled = true;
367+
}
368+
else {
369+
document.getElementById('china-information').style.display = 'none';
370+
document.getElementById('nonchina-information').style.display = 'block';
371+
document.getElementById('devprog-cta-submit').disabled = false;
372+
}
373+
});
374+
}
375+
376+
};
377+
378+
304379
// SECTION 5: Marketo Developer Program Form Embed
305380
const formScript = document.createElement('script');
306381
formScript.src = '//engaged.arm.com/js/forms2/js/forms2.min.js';
@@ -315,6 +390,9 @@ <h2 class="modal-title">Program Registration Success</h2>
315390
formContainer.appendChild(form.getFormElem()[0]);
316391
formContainer.querySelector('form').style.display = 'block';
317392

393+
// Handle country select change for dynamic China data processing
394+
countrySelectHandler();
395+
318396
// Handle successful form submission
319397
form.onSuccess(function() {
320398
// Hide 'form-display' and devprog submit button and show 'form-completed'

0 commit comments

Comments
 (0)