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

144
Views
How to fill in programmatically Django admin built-in autocomplete?

I would like to use JS in the Django admin to fill in programmatically a field that uses the built-in autocomplete option (NOT autocomplete-light).

Let's say the field is called myfavfield. I can retrieve it with JS as follows $("#id_myfavfield"). If it is already filled in with some values, I can retrieve them with $("#id_myfavfield").val();, which, for example, returns ['1', '4'], I can also clear myfavfield with $("#id_myfavfield").empty();. However, I can't fill it in, for example, by running $("#id_myfavfield").val(['2', '4', '5']); or any other way that I have tried. Does anybody know how one can achieve that?

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