I have a problem with submiting data into the django
form so basically I have model with the 2 fields which take value 1 or 0 so I Created functions with jquery
and I set them into the buttons but when i press double click it submit the value of .click
function not the dblClick
function.
my code is here in html:
<br>
<button type="submit" id="up_vote_btn">Up Vote </button>
<br>
my jquery code:
<script>
$(document).ready(function(){
$("#up_vote_btn").click(function(){
document.getElementById("id_up_vote").setAttribute('value','1');
document.getElementById("id_down_vote").setAttribute('value','0');
});
});
$(document).ready(function(){
$("#up_vote_btn").dblclick(function(){
document.getElementById("id_up_vote").setAttribute('value','0');
document.getElementById("id_down_vote").setAttribute('value','0');
});
});