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

125
Views
Cuadros de selección de rango de tiempo y javascript que deshabilitan el tiempo anterior

Tengo un selector de tiempo de formulario html (Hora de inicio - Hora de finalización). Quiero que cuando el usuario, por ejemplo, seleccione la fecha de inicio a las 11:00, la fecha de finalización debe convertirse en +1 hora a las 12:00 en nuestro ejemplo y las horas anteriores deben estar deshabilitadas.

Hice algo, pero solo desactiva las horas anteriores y en la fecha de finalización obtengo la misma hora que seleccioné en la fecha de inicio. Aquí está el código:

 <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
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!