Im coding the following form in HTML:
<form action="#" method="post"> <input type="email" name="email"></input> <input type="email" name="email_conf"></input> <input type="submit" value = "Entrar"></input> </form> As Im using Flask, I would retrive the form data using request.form('email') and request.form('email_conf') and compare the content returned by the function.
But I would like to know if I could use Python in the .html file to compare the inputs by doing something like
<form action="#" method="post"> <input type="email" name="email"></input> <input type="email" name="email_conf"></input> {% if email == email_conf %} <input type="submit" value = "Entrar"></input> {% endif %} </form> Thanks for your help!
{% if email == email_conf %}is excalty what you are asking, comparing the 2 value with Python 's Jinja (Without JavaScritp=