I have an extra field in a django form that triggers javascript to change the fields in other forms:
class MyForm(forms.ModelForm):
my_extra_form_field = forms.ChoiceField()
class Meta:
model = MyModel
fields = ["field1", "field2"]
field_order = ["field1", "my_extra_form_field", "field2"]
How can I ensure that my_extra_form_field is not included in the submiteed form?
>Solution :
adding to NixionSparrow’s answer:
You may need to add the attribute required as mentioned in the docs here
my_extra_form_field = forms.ChoiceField(required=False)