Design comparison
SolutionDesign
Solution retrospective
All forms of constructive feedback is welcome
Thank you ahead of time :)
Community feedback
- @yishak621Posted almost 2 years ago
Its great the layouts and everything but when we come to the validation error messages there is a little bug to fix ....for the card number and month inputs ,when the user enters invalid input the text must refer what type of mistake happen by a user eg.
invalid month input
or 'format should be like these '...for example i use moment js library to validate the month and year so the error message will be changed according to error type//individual validation for month and year using moment.js function Validate(input, type, format) { return input.addEventListener('input', () => { if (moment(input.value, `${format}`, true).isValid()) { hideErrorText(dateErrorMessage); return true; } else { dateErrorMessage.textContent = `the ${type} format should be like these 05`; dateErrorMessage.classList.add('show'); } }); } Validate(monthInput, 'Month', 'MM'); Validate(yearInput, 'Year', 'YY');
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