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

119
Vistas
Generate dates onclick in datepicker

I'm using "datepicker" script and I've created a link that generates a series of dates on click.

Javascript

function change(){
    document.getElementById('datepicker').value='06/10/2022,20/10/2022,17/11/2022';
}

HTML

<input type="text" id="datepicker" name="test" class="datepicker" placeholder="select dates"><br>
<a href="#" onclick="change()">link</a>

On click on the link, these dates appear in the input field, but in the calendar these dates are not enabled...
They become enabled if I put the cursor in my input field and I have an action like "Ctrl+A" for example.

Does anyone have any idea ? thank you so much ! :-)

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

0

If you want the dates replace text "link" on click you should set id="datepicker" on your anchor tag.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Finally i found the solution :

Javascript

function change(){
$('#datepicker').val('06/10/2022,20/10/2022,17/11/2022').datepicker('update');
}
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