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

Submitted

Mortgage Repayment Calculator

P

@mehmetfatihdurna

Desktop design screenshot for the Mortgage repayment calculator coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


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

I completed this challenge with a design almost identical to the one in Figma. I am proud of myself for that. But my codes are so confusing. I am going to learn clean code techniques.

What challenges did you encounter, and how did you overcome them?

I didn't know how can i control inputs. I was only asking users to enter numbers. Then i realized input tags have onInput attribute. Then i wrote this function:

function inputControl(e){
        e.target.value = e.target.value.replace(/[^0-9]/,'');
    }

    

I made sure that users could only enter numbers with this function.

Community feedback

@illusiveCode

Posted

Great work overall! Instead of creating a function to handle the input value to only be numbers, you can use the attribute of type="number" on the input for the html :)

Marked as helpful

1

@danielchavezs

Posted

It looks really good, and state management seems to be working great as well. I woud probably only advice you to change the functionality of the "Clear All" button as it is recharging the whole page; take advantage of Vite - React, as you are already doing it in other features to keep it running as a SPA without unnecesary page reloads. Kuddos for the great work!

1

P

@mehmetfatihdurna

Posted

@danielchavezs Thank you for your advice, I will work on it. Sometimes developers don't want to touch their code if it works. My situation is a bit like that too :)

0

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