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
It seems in this particular case you don't need the boolean field in the
model. As the behaviour you want has to do only with the form, you just
have to add an additional required checkbox in this model form.
class MyModelForm(forms.ModelForm):
involved = forms.BooleanField(required=True)
clas
Hi,
My checkboxes are giving me grief.
I want to make it required for the user to check a checkbox before being
allowed to submit a forms.
I'm using model forms so the checkbox is defined as a models.BooleanField
in my models.py. I have included blank=False, though this should be the
default.
3 matches
Mail list logo