Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda