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!
{{email}}
{% endif %}` however even when the emails are the same nothing is showed on the screen. – leoperassoli Jan 03 '21 at 10:29