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

127
Vistas
Javascript click action not triggering of input date

I am trying to trigger the opening of a calendar date picker when clicking on a related text field. My HTML looks like this:

<form action="test.html" method="post">
   <input type="date" id="dueDate" name="dueDate">
   <input type="text" id="dateText" name="dateText" onclick="dateTextClick()">
</form>

and my Javascript looks like this:

<script>
    function dateTextClick() {
        var $input = document.querySelector("#dueDate");
        $input.focus();
        $input.click();
    }
</script>

The first line does work, and the date input receives the focus. However, the click action is not triggered, so the date picker calendar does not appear.

In case it's relevant, this code is embedded in a Joomla article, but so far in my experience that hasn't made a difference to the use ofJavascript.

I would be grateful for any pointers as to how to fix this!

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