This is a solution to the Multi-step form challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- Complete each step of the sequence
- Go back to a previous step to update their selections
- See a summary of their selections on the final step and confirm their order
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
- Receive form validation messages if:
- A field has been missed
- The email address is not formatted correctly
- A step is submitted, but no selection has been made
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- Vanilla js
I learn a lot in this project
To see how you can add code snippets, see below:
electedAddOns.forEach((addOns) => {
const check = addOns.querySelector('input');
check.checked = false;
addOns.addEventListener('click', (e) => {
let name = addOns.querySelector('h2');
name = name.innerText;
let amount = addOns.querySelector('.amountx');
amount = amount.innerText;
const summarySec = generateSummaryDom(name, amount);
if (!addOns.classList.contains('focus')) {
check.checked = true;
addOns.classList.add('focus');
summaryMainChild.appendChild(summarySec);
addOns.summarySec = summarySec;
} else {
check.checked = false;
addOns.classList.remove('focus');
const summaryElements = summaryMainChild.querySelectorAll('.summary-child');
summaryElements.forEach((summaryElement) => {
const summaryName = summaryElement.querySelector('p').innerText;
if (summaryName === name) {
summaryMainChild.removeChild(summaryElement);
}
});
}
updateTotal();
});
});
I would love to improve my multipage website implementations.
- Frontend Mentor - @mallow12