I have a form with two submit buttons as per below.
<form id="choice" name='form' method="POST" action="/">
<button type="submit" name="vote" id="btnMinus" value="1"></button>
<button type="submit" name="vote" id="btnPlus" value="2"></button>
</form>
I have this code in order to prevent that the form is not submitted twice. However, it gives a "bad request" error. Seems that it doesn't send the "vote" value. Any ideas?
$('#choice').submit(function(e)
{
e.preventDefault();
$('#btnPlus').attr('disabled',true);
$('#btnMinus').attr('disabled',true);
this.submit();
});