I've created a Django form with a drop-down menu in one of the fields. When I tried to submit the form without selecting the item from the drop-down list, this one is not submitted because I have defined in my code that it will not be not submitted unless the form is valid with the help of
However, the validation error message was not displayed. In the browser console, the is an error message
An invalid form control with the name = 'start_position & # 39; can not be developed.
I read some questions about it and they said it had happened because there was a hidden field. After inspecting an item, it's true that div class = "start_position". is hidden.
However, I do not know how to solve this problem in Django.
This is the code that creates a drop-down field.
LocationForm class (forms.Form): start_position = forms.ModelChoiceField ( required = true, label = "Starting position", queryset = Location.objects.all () )
I want the validation message to be displayed as in the other field (I have tried
DateField and validation works normally).