Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 11 months ago

Interactive card details form

tailwind-css
P
BartoszMokrzycki•240
@BartoszMokrzycki
A solution to the Interactive card details form challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What specific areas of your project would you like help with? Issue: Expiry Month Input Validation

One specific challenge I faced during this project involved the expiry month (MM) input field. Instead of using a <select> dropdown for users to choose a month, I opted for a text <input> field to allow direct input. However, this introduced the following problem:

  • Challenge:
    I wanted to restrict the user from entering values greater than 12 in the MM field. While it was straightforward to validate the input after submission or update the value dynamically, I couldn't prevent the user from typing invalid values (e.g., 13, 25) directly into the field in real-time.

  • Impact:
    This limitation negatively affects the user experience (UX) since users might input incorrect values and only receive feedback after submission or when focusing out of the field. Ideally, the input should restrict invalid values as they are being typed.

  • Request for Help:
    If you have suggestions or know a better way to implement real-time validation for numeric input fields without relying on <select> elements, I’d appreciate your input! The goal is to maintain a seamless UX while ensuring valid inputs.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on BartoszMokrzycki's solution.

Join 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License