How to populate a submit popup based on the value you filled to evaluate a condition | flask

女生的网名这么多〃 提交于 2019-12-11 04:46:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!