I have some data(checkbox and input field) in template file which I want to send to views.Due to page refresh upon submit checkbox field is unchecked.So how to send data to django view without using html form.Is it possible using jquery/ajax?
<form id="myform">
{% csrf_token %}
<p id=id3>Categories</p>
{% for i in My_Cat %}
<input type="checkbox" id="mycheck" name="cat_name" value="{{i.category}}">{{i.category}}<br>
<!--category is db column -->
<!--My_Cat is the context from the view -->
{% endfor %}
<p>Price</p>
₹<input type="text" name="min_price" maxlength="4" size="3" >
to ₹<input type="text" name="max_price" maxlength="4" size="3"><br>
<input type="submit" value="Go" style="margin-top: 6px;">
</form>
Aucun commentaire:
Enregistrer un commentaire