Django Form Widgets Simple text input widget

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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'


Got any Django Question?