Bootstrap django-datetime-widget is a simple and clean widget for DateField, Timefiled and DateTimeField in Django framework. It is based on Bootstrap datetime picker, supports both Bootstrap 3 and Bootstrap 2
Since this widget makes the input readonly by default, browsers' built-in validation is not performed for required fields before form submission. This becomes an annoying problem when the form has file field(s), since validation occurs on server and the form returns with empty file inputs.
This feature removes the readonly attribute if required is present and mimics the readonly behaviour with jquery. With this, browser's validation will be performed.
May be there is a better way of solving this, I'm open to any suggestions!
Since this widget makes the input
readonly
by default, browsers' built-in validation is not performed for required fields before form submission. This becomes an annoying problem when the form has file field(s), since validation occurs on server and the form returns with empty file inputs.This feature removes the
readonly
attribute ifrequired
is present and mimics thereadonly
behaviour with jquery. With this, browser's validation will be performed.May be there is a better way of solving this, I'm open to any suggestions!
Hector.