How to increase the value of a quantity field with jQuery?
- by amir
I have a form with some quantity field and a plus and minus sign on each side,
<form id="myform">
product1
<input type="submit" value="+" id="add">
<input type="text" id="qty1">
<input type="submit value="-" id="minus">
product2
<input type="submit" value="+" id="add">
<input type="text" id="qty2">
<input type="submit value="-" id="minus">
</form>
I'd like to increase the value of the field by one if the add
button is pressed and decrease by one if minus is pressed.
Also the value shouldn't get less than 0.
Is there a way to do this in jQuery?