Design comparison
SolutionDesign
Solution retrospective
** What I added extra from requested **
- A credit card icon
- Set transition for confirm button and credit card icon.
Any feedback is welcome :)
Community feedback
- @miranleginPosted about 2 years ago
Hi Yunus,
regarding input fields you can do some improvements
- use appropriate input types for form fields MDN documentation on Input Types especially for mobile users because keyboard is different for every input type
- for numbers you can go with both
input type="number"
orinput type="tel"
, there are couple of differences though so you can explore more on the link - also there is a way to limit number of characters in form fields with
maxlength
atribute; for examplemaxlength="2"
- for MM field you know the minimum and maximum values accepted so you can add
min
ormax
attributes aswell - another attribute worth considering is
pattern
where you can specify accepted values as a regex pattern; for examplepattern=="[0-9]{1,2}"
Before:
<input type="text" class="form-control" id="month" placeholder="MM" autocomplete="off">
After:
<input type="number" maxlength="2" min="1" max="12" pattern=="[0-9]{1,2}" title="Only numbers from 1 to 12" placeholder="MM">
Keep coding!
Marked as helpful0@yunusemrecinarPosted about 2 years ago@miranlegin I searched about the pattern but I only found js ones. Thanks!
0
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