Home > Input Components

Input Components

The following components are used when rendering form inputs corresponding to model field definitions. These components implement a common subset of the XLSForm question types and Django field types.

To implement a custom input type, or override the defaults, register an input components plugin.

Name HTML Equivalent Django Type XLSForm Type
Input <input type={text,number,...}> CharField, IntegerField, FloatField string, int, decimal
Date <input type=date> DateField date
Time <input type=time> TimeField time
DateTime <input type=datetime-local> DateTimeField dateTime
Hidden <input type=hidden> n/a hidden
Choice Inputs      
Checkbox <input type=checkbox> BooleanField n/a
Toggle n/a CharField(choices<5) select one
Radio <input type=radio> CharField(choices<10) select one
Select <select> CharField(choices>=10) select one / select
ForeignKey <select> ForeignKey constraint=wq:ForeignKey
Binary Attachments      
File <input type=file> FileField file, video, audio
Image <input type=file accept="image/*"> ImageField image
Geospatial Inputs      
Geopoint n/a PointField geopoint
Geotrace n/a LineStringField geotrace
Geoshape n/a PolygonField geoshape