asaglimbeni / django-datetime-widget

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
Other
219 stars 125 forks source link

feat: solve readonly/required conflict #99

Open ajendrex opened 7 years ago

ajendrex commented 7 years ago

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!

Hector.