Design comparison
SolutionDesign
Community feedback
- @jemeneradevPosted almost 3 years ago
Consider using <input type="number"/>
It enforces correct values (only numbers, rejects letters) and you can specify min and max values. Check this link for its documentation :
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
Overall the doc for input is quite interesting !
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
Marked as helpful1@GuyNamedEJPosted almost 3 years ago@jemeneradev Thank you for the resources! I went ahead and changed the fields to numbers however I did read that there is a bug that on some browsers characters can still be entered.
1
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