Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
Limit HTML date input to today's date

I have an input type date on my form that I limited to only use today's date by setting the min and max attribute to today with the help of javascript. The problem is the user can still type a different date instead of picking it using the little calendar popup. Is there a way to not allow this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

According to specification min and max shall only affect form submission if violated. GUI behavior is not standardized and therefore does depend on the browser vendor and its specific version. For example, on Chrome 97 I'm not allowed to type the year 2019 in this demo page. As you can see the year text is gray and I'm not allowed to alter it:

enter image description here

You should use a non-native element, to achieve consistent behavior. See for example JQuery DatePicker

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda