Django Simple text input widget


Example

The most simple example of widget is custom text input. For instance, to create an <input type="tel">, you have to subclass TextInput and set input_type to 'tel'.

from django.forms.widgets import TextInput

class PhoneInput(TextInput):
    input_type = 'tel'