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

191
Views
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
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!