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

127
Vistas
Time range select boxes and javascript that disable previous time

I have html form (Start Time - End Time) time picker. I want when user for example selects Start date 11:00, End date should become +1 hour 12:00 in our example and previous hours should be disable.

I made something but it only makes previous hours disabled and in end date I get same hour which I select in start date. Here is the code:

<script>
$("select[name='from_time']").on("change", function(){
$("select[name='to_time']").empty();
var startix = $("select[name='from_time'] option:selected").index();
$("select[name='from_time'] option").each(function(ix, el){
if (ix >= startix) {
$(this).clone().appendTo("select[name='to_time']");
}
});
});
</script>
about 4 years ago · Juan Pablo Isaza
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