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

192
Vistas
How to compare the value of an input with an object field in django template?

I want to compare the value of an object field to the value of an input that i have set the value with jQuery on a click event.

Here is the jQuery function:

<script>
    $(document).ready(function()
    {
        $('.position').click(
            function(){
                var id=$(this).attr('id');
                alert(id)
                $('.info-tooltip').toggleClass("hidden");
                $('.header').addClass("popup");
                $('.section').addClass("popup");
                $('#map-value').val(id);
            },
        )
        $('.remove-link').click(
            function(){
                $('.info-tooltip').addClass("hidden");
                $('.header').removeClass("popup");
                $('.section').removeClass("popup");
            },
        )
    });
</script>

I want to access the value of the input with the id="map-value" with the id of the object field that I am accessing it with an for cycle like this

<form>
     <input type="text" value="1" id="map-value" name="map-value">
</form>
{% for p in points %}
   {% if p.id == form.input.value %}
     //i will show sth here
   {% endif %}
 {% endfor %}

about 4 years ago · Juan Pablo Isaza
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