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

221
Vistas
How to get updates from the input field in Django

I have this code in template

{% block content %}
<script>
    function onChange(event) {
        console.log("log")
    }
</script>
<h3>List</h3>

<input type="text" placeholder="Filter by..." onchange="onChange(event)" value={{ searching_value }} >

But it doesn't seem to work..

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The value from the event should be accessed via event.target.value as per the MDN docs. You can't access this.value how you are. onChange should accept an event argument and you pass the reference to the function for the onchange attribute.

about 4 years ago · Juan Pablo Isaza Denunciar

0

As @schillingt mentioned, the argument of onChange is a Event. So you should treat it like one :)

{% block content %}
<script>
    function onChange(event) {
        console.log(event.target.value)
    }
</script>
<h3>List</h3>

<input type="text" placeholder="Filter by..." onchange="onChange" value="{{ searching_value }}"/ >
about 4 years ago · Juan Pablo Isaza Denunciar
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