[Answered ]-Django Form – Select a valid choice. That choice is not one of the available choices

2👍

This is due to the way Django validates forms.

To put it simply, it does not expect to be answered a choice that it did not generate.

In the docs :
https://docs.djangoproject.com/en/1.11/ref/forms/fields/#choicefield

Validates that the given value exists in the list of choices.

A simple “Django ajax choice form” search on this site will return you some possible workarounds.

Leave a comment