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

278
Views
Flatpickr doesn't show after html code is rendered

I am using Flatpicker to show a datetime picker, and the following code works fine, if i click on the input field, the calender opens and the user is able to pick a datetime.

<input id="datetime" class="form-control datetime" type="text" name="test">

Now I have a button, that creates html with javascript and adds a new input on the screen. The input field is shown as expected, but clicking it does not open a Flatpickr calender.

$('#addplanning').click(function() {
  let template =
    `<tr data-index="">
       <td>
         <input id="datetime" class="form-control datetime" type="text" name="planning[` + i + `][start_date]" value="{{$start_time->toDateTimeLocalString()}}" required>
       </td>
     </tr>`;
        
   i++;
   $('#planning-body').append(template);
});

The standard html 'datetime-local' function seems to work, but using Flatpicker or jqueryui doesn't show the calenders.

Does anyone have an idea how I could make this work?

about 4 years ago · Santiago Trujillo
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!