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 %}