from flask.ext.wtf.html5 import NumberInput
class Form(Form):
value = NumberInput( [Required()])
submit = SubmitField('Next')
{{ form.value }}
The code above will output this:
<wtforms.widgets.html5.NumberInput object at 0x3c94a50>
Well, what i am expecting is:
<input type="number">
Basically, the question is how can I render an input type="number"
with wtforms.
First of all, your value
should be a field, not a widget.
value = IntegerField(widget=NumberInput())
WTForms fields generate html on call, so try
{{ form.value() }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With