
Responsive Mortgage Repayment Calculator using HTML CSS and JAVA
Design comparison
Solution retrospective
I’m most proud of implementing a fully responsive mortgage calculator using Tailwind CSS and JavaScript. I also improved form validation by providing real-time feedback and ensuring accessibility compliance.
Next time, I would optimize my JavaScript code by making it more modular. I’d also explore adding a framework like React or Next.js to improve scalability and performance.
What challenges did you encounter, and how did you overcome them?Challenges & Solutions ❌ Challenge: Ensuring the mortgage repayment calculator was fully responsive across all screen sizes. ✅ Solution: I used CSS Grid and Flexbox along with a mobile-first approach to make the layout adapt smoothly across devices.
❌ Challenge: Implementing real-time form validation and error handling. ✅ Solution: I used JavaScript to check user input and displayed error messages dynamically to improve user experience.
❌ Challenge: Handling edge cases (e.g., negative values or empty inputs). ✅ Solution: I added extra validation checks to prevent invalid inputs and used parseFloat() to ensure only valid numbers were processed.
What specific areas of your project would you like help with?Did I follow best practices to make my project accessible to all users? Is my validation logic effective, or are there better ways to handle errors?
Community feedback
- P@QuentinPettonPosted about 2 months ago
Hey! Instead of using innerHTML to replace the entire results section, a better approach would be to use CSS to hide/show elements dynamically.
For example, you can add a .hidden class (display: none;) to initially hide the results and remove it when the form is submitted. This improves performance, keeps event listeners intact, and makes the code more maintainable.
I saw you use var type, now you can use let or const for your variable
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin 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