Skip to content Skip to sidebar Skip to footer

How Do I Use "tel", "number", Or Other Input Types In WTForms?

I want to use a phone number field in my form. What I need is when this field is tapped on Android phone, not general keyboard, but digital only appears. I learned that this can be

Solution 1:

This appears to be missing from the WTForms docs, but there are field definitions for all the input types added in HTML 5.

from wtforms.fields.html5 import TelField

phonenumber = TelField()

Until they're added to the docs, here's their definition in the code.


Solution 2:


Post a Comment for "How Do I Use "tel", "number", Or Other Input Types In WTForms?"