Design comparison
Solution retrospective
I have No idea of how to show the errors and how it should look like so I just made conditions to show the result only if the user types valid numbers ... waiting for feedback or help or bug hunter xD
Community feedback
- @rantavishavPosted over 3 years ago
Hi, I am also New For coding World and tried out couple of challenges from this site. My first challenge was also this one. So I can give you a tip how I implemented Error messages.
So basically I first set the error message in html file and give it desired css, at this time error message should be visible as suggested in the design. After that you make that error message element visibility : hidden. So whenever user Put the wrong input through JS You will check if input is correct or not, if not just make that style visibility: visible. This is old school trick but love it.
Also You want to show result (tip/Amount and Amount/Person) as default values whenever user Put wrong input.
Also your Reset Button didn't reset the tip % style back to default.
Hope it helped. And yes it was very impressive :)
2@CH4R4FPosted over 3 years ago@rantavishav yep I was searching for a method to select the
::after
pseudo class and change its content depends on the error (invalid number or empty input) but I Was lazy .. your idea looks good0
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