Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda