I want to call a django function on my Proceed button and pass the selected value to that function, how can I do that ?
Here's the form:
<select id="the-id">
{% for i in z %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
<form method="post" novalidate>
{% csrf_token %}
<a class="btn btn-outline-secondary" role="button">Proceed</a>
<a href="{% url 'employee:products_table' %}" class="btn btn-outline-
secondary" role="button">Nevermind</a>
</form>
</select>
views.py
def warehouse_details(request):
queryset = AllotmentDocket.objects.filter(send_from_warehouse = #to be fetched from the form)
print("queryset is ", queryset)
return render(request, 'packsapp/employee/allotwarehousedetails.html', {'query': queryset})
Urls.py
path('warehouse-details/', warehouse_details, name='warehouse_details'),