Design comparison
Solution retrospective
I couldn't understand the task properly. anyhow tried my best to accomplish the tasks. kindly reviews it and give your valuable suggestions.
Community feedback
- @yacineKahlerrasPosted about 2 years ago
Hey @abymani good job on the design i just have a few suggestions that might might be helpful
- you can set the type of the input to number so it accepts numbers only without using any javascript code
- i couldn't enter numbers using my numbers pad that's because in your form validation function you didn't include the numbers pad keycodes in the conditions
- the math of the tip and the total amount should be divided by the numbers of people there
let tipAmount = ( bil * tip /100 ) / persons; let total = ( bil / persons ) + tipAmount;
other than that good job on the challenge and happy coding !
Marked as helpful1@abymaniPosted about 2 years ago@yacineKahlerras Thanks for the help i wasn't able to understand the requirements regarding tip calculation. Problem with setting the input type to number is unnecessary display of number up and down arrows. Which i don't know how to get rid of. That's the reason behind using my own javascript form validation. I will look into including numbers pad keycodes.
1@yacineKahlerrasPosted about 2 years ago@abymani you're welcome, glad i helped a bit ! someone offered me a solution for the arrows problem when you put the type to number which i just tried on my project and it worked :
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { display: none; -webkit-appearance: none; margin: 0; } input[type="number"] { -moz-appearance: textfield; /* Firefox */ }
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