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

117
Views
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 answers
Answer question

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 Report

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