How can I pre-check a CheckboxInput of a form?
CheckboxInput
I tried this in __init__:
__init__
self.fields['name_field'].widget.attrs['checked'] = 'checked'
But it doesn't work..
My field is a boolean field in model and in my form it's a checkbox input.
Aucun commentaire:
Enregistrer un commentaire