0๐
โ
Iโve just solved. By adding name="product"
, Iโve achieved it. Thank you for your cooperation!
<select>
{% for product in products %}
<option value="{{ product.id }}">{{ product.name}}</option>
<div class="error">{{ form.product.id.errors }}</div>
{% endfor %}
</select>
<select name="product">
{% for product in products %}
<option value="{{ product.id }}">{{ product.name}}</option>
<div class="error">{{ form.product.id.errors }}</div>
{% endfor %}
</select>
๐คToshi
1๐
You send data to server by submitting html form. See form example from step 4 of the tutorial โ https://docs.djangoproject.com/en/1.10/intro/tutorial04/
See also http://www.w3schools.com/html/html_forms.asp for general description of html forms
Source:stackexchange.com