Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Desktop design screenshot for the Multi-step form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
4advanced
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Definetily I'll do this one in React, TypeScript with Vite and Vitest next time!!! And other than that, I'll be focusing on resolving the JS problem(where in the add ons section, when you select yearly payment, you should see yearly prices, not monthly or incorect calcs)

What specific areas of your project would you like help with?

Any ideas to show properly the add-ons when is yearly(not showing as expected) is welcome!

Community feedback

Svitlana Suslenkovaβ€’ 3,430

@SvitlanaSuslenkova

Posted

Any ideas to show properly the add-ons when is yearly(not showing as expected) is welcome! - this. it's strange that you did it with prices but not text, you were almost there.

const texts = document.querySelectorAll(text's class);

function switchPrice(checked) { ...

if (checked) { texts.forEach((text)=> {add class or style here} .... }

else { ... texts.forEach((text)=> {display none here}

Marked as helpful

1

@sksksk2024

Posted

Hello, @SvitlanaSuslenkova !! πŸ‘‹πŸ‘‹

I think I'm brain freezed, I can't understand this problem. Can you show me the solution. Maybe give me some tips in using alternative variables(I'm not that good at those).

0
Svitlana Suslenkovaβ€’ 3,430

@SvitlanaSuslenkova

Posted

@sksksk2024 oh, I'm sorry, I checked the wrong stage of the form and talked about the plans.

In your HTML create your <p class="texts">2 month free</p>

Here is the function that you already created:

function switchPrice(checked) {

const monthlyPrice = [9, 12, 15];

const prices = document.querySelectorAll(".plan-priced");

const texts = document.querySelectorAll(.texts);

if (checked) {

texts.forEach((text)=>{text.style.display = "block"}

prices[0].innerHTML = $${monthlyPrice[0] * 10}/yr; prices[1].innerHTML = $${monthlyPrice[1] * 10}/yr; prices[2].innerHTML = $${monthlyPrice[2] * 10}/yr; setTime(true) } else {

texts.forEach((text)=>{text.style.display = "none"}

prices[0].innerHTML = $${monthlyPrice[0]}/mo; prices[1].innerHTML = $${monthlyPrice[1]}/mo; prices[2].innerHTML = $${monthlyPrice[2]}/mo; setTime(false) } }

Marked as helpful

1
Svitlana Suslenkovaβ€’ 3,430

@SvitlanaSuslenkova

Posted

@sksksk2024 was a question about <p class="price">+$1/mo</p>?

const prices = document.querySelectorAll(".price"); You have to pass time to your function, if(time) {prices[0].innerHTML=} else {...}

Marked as helpful

1
Jordan Davenportβ€’ 660

@jjdavenport

Posted

The path to your images is wrong, should be "./assets/images/img".

1

Jordan Davenportβ€’ 660

@jjdavenport

Posted

@sksksk2024 The path to your images, to fix the problem with the path to the fav icon would be, <!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png" <------------- />

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord