Hi,
I am trying to create several input fields with forms.IntegerField. I want to make the fields optional, i.e. the fields can be left blank, for example, the “J” and “N” fields in the screenshot. Could someone please suggest how to do it?
When I press the button to submit the form, it saids “Please fill out this field”. It seems like I can not set “blank=True” when defining the integerField.
The blank=True option is for ModelForm fields. You want to set required=False for these fields.
Side note: I find it highly unusual that you are creating one field per form. It seems like you’re creating a lot of excess work for yourself in this situation.