Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!