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

120
Vistas
Jquery datepicker is initally opened not on select

I am new with JQuery, I have a problem. I used jQuery datepicker. When I first open the my site the datepicker open as well. However in my function I specificaly used onSelect function but still see them initially. How can I prevent this from happening? I tried using the below code. First, it shows the datepicker, then hides it but now can't open it on select.

 $('#datepicker').datepicker('show')  // to hide when open the site 
 $('#datepicker').datepicker('hide')  

This is my original code. :

$( function() {
  var days = ['Pazar','Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'];
   $('#datepicker2').datepicker({
    dateFormat: 'dd M, yy',
   language: 'tr',
    onSelect: function () {
  var date = $(this).datepicker('getDate' ,true);
  var day = date.getDay();
  console.log(days[day]);
  console.log(day);
  $( "#day2" ).html( days[day] );
}

 });
  $("#datepicker2").datepicker().datepicker("setDate", new Date());
  var day = $('#datepicker2').datepicker('getDate').getDay();
  $( "#day2" ).html( days[day] );
  });

I have to datepicker btw one is called datepicker the other one is datepicker2

    <div class="input-wrapper">
          <i class="far fa-calendar-alt"></i>
          <input id="datepicker">
          <span id='day'></span>
     </div>
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