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

145
Vistas
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
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