Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda