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

279
Visualizações
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
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