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

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