I'm going to assume that we're talking about a single checkbox (an "I
agree to the terms" checkbox).
First, remember that unchecked is not the same as "blank", it is
"false", so "blank=False" is subject to interpretation.
There are two places where you might insist that the box be checked:
in the browser; and in the form processing. You *must* provide at
least the latter, since the first depends on JavaScript (since, as
you've discovered, the required attribute of a checkbox input doesn't
always work across browsers), which is disable-able and otherwise
circumventable.
The js approach is to disable the submit button on load (stays enabled
if js is disabled or the page is otherwise broken) and attach an on
change handler to the checkbox that enables or disables the submit
button based on whether the checkbox is now checked or not.
But the mandatory part is to add a validator to the field (see
https://docs.djangoproject.com/en/1.4/ref/forms/validation/ ) that
fails with a suitable error message if the checkbox field value is
False.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/django-users/-/4bBr_gr_Z44J.
> To post to this group, send email to
django...@googlegroups.com.
> To unsubscribe from this group, send email to
>
django-users...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/django-users?hl=en.