Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
Problem: Date input onchange running function on number keys input

I have 2 date fields; end_date and to_date. When end_date is set to before to_date it changes to_date to the value of end_date. The problem I'm having is if the user types in the date field rather than using the calendar picker, it accepts each of the keypresses as a valid date.

For example: Both end_date and to_date = 18/10/2022

The user wants to change end_date to a later date (ex 20/11/2022), so in theory it should not change to_date. When the user then goes to type 20 the date field will run the function with the date 02/10/2022, thus changing to_date (because typing "2" will change the date to 02).

The only solution I have right now is just making it impossible for the user to use number keys in the field, however this is not optimal. Does anyone have a better solution?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!