问题
I have a jinja html template which has a form. The form is a wtforms , assume it like
>>> from wtforms import Form, BooleanField, IntegerField, SelectField, StringField, validators
>>> class COOLForm(Form):
action = SelectField('Action', description='Action', choices=[('online', 'ONLINE'), ('offline', 'OFFLINE')])
...
The html template looks something like
<div class = "major"
<form id="blah">
<input type="hidden">
{{ forms.form_field(coolform.action) }}
.
.
</div>
Then in the same file i have a submit
div where i want to evalute the condition if a user seleted ONLINE or OFFLINE, i will show a different content.
something like
{% if coolform.action. == "online" or coolform.action. == "ONLINE" %}
blah
{%else%}
blah
I am not able to check how can I do that if condition
来源:https://stackoverflow.com/questions/58851035/how-to-populate-a-submit-popup-based-on-the-value-you-filled-to-evaluate-a-condi