Flask, WTForms: Is there a way to make a StringField in the form _temporarily_ hidden?
问题 This is my model: class F(Form): a = StringField('a', validators = [validators.DataRequired()]) Is there a way to make a StringField in the form temporarily hidden? Something like: @app.route('/f', methods = ['GET', 'POST']) def f(): form = F(request.form) if foo(form): form.a.__MakeTemporarilyHidden__() else: form.a.__MakeItVisibleAgain__() if request.method == 'GET': return render_template('f.html', form = form) I am aware of wtforms.fields.HiddenField but I want to dynamically switch