I have a form composed of 2 ChoiceField and a CharField. The second ChoiceField is populated via ajax when an item of the first one is selected.
The template populating it is the following :
{% for a in assets %}
<option value="{{ a.asset_id }}">{{ a.asset_name }}_{{ a.asset_description }}</option>
{% endfor %}
When I try to submit the form I get the following error :
Select a valid choice. 20 is not one of the available choices.
Pointing to the second ChoiceField, 20 corresponds to the {{a.asset_id}} of the item selected.
I saw this error on other forums but it's almost always due to multipleChoiceField which is not my concern.
What am I doing wrong ?