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

192
Visualizações
Uncaught TypeError: $(...).datetimepicker is not a function when I call it in js function

I am trying to change option of datetimepicker when I call a function but i'm getting the error "Uncaught TypeError: $(...).datetimepicker is not a function" when the datetimepicker is inside of the function refresh. What's the problem ?

Here is the code :

<script src="~/Content/vendor/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="~/Content/vendor/datepicker/moment.js"></script>
<script type="text/javascript" src="~/Content/vendor/datepicker/tempusdominus-bootstrap-4.js"></script>
<link rel="stylesheet" href="~/Content/vendor/datepicker/tempusdominus-bootstrap-4.css" />


<script type="text/javascript">

    $('#representant_date_dem' + 1).datetimepicker({ format: 'DD/MM/YYYY', date: moment() }); //working

    function refresh(i) {
        var id = document.getElementById('myTableDeplacementPrestation').rows.length;
        for (var j = i; j <= id; j++) {
            if ($('#representant_date_dem' + j).length) {
                $('#representant_date_dem' + j).datetimepicker({ format: 'DD/MM/YYYY', date: moment() }); //not working
            }
            $('#hourDemandeurDebut' + j).datetimepicker({ format: 'HH:mm', date: moment() });
            $('#hourDemandeurFin' + j).datetimepicker({ format: 'HH:mm', date: moment() });
        }
    };

</script>
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