Hi everyone please suggest me how to break
for loop in jinja 2
I am using for
loop with if
condition and I want to break the loop if my if
condition is true
this is my code
function refercheck(){
var input_value = document.getElementById('refer').value;
{% for i in refer %}
document.getElementById("valid").innerHTML = '';
if( input_value == "{{i.refercode}}" ){
$('#valid').append('Referred By {{i.username}}');
}
I am using this function in input onkeyup="refercheck()"
and I an sending the dict
from view function. My dict key is refer I am sending all user data and checking the input is same as other user refercode. The above code is give me only last row refercode is same please tell me how can I break for loop when my if condition is true or any other suggestions for it.