fixed the numeric picker

master^2
Marek Baczynski 6 years ago
parent a789310c2d
commit ea4b383e66

@ -1,3 +1,4 @@
$(document).ready(function(){
var quantitiy=0;
@ -6,11 +7,13 @@ var quantitiy=0;
// Stop acting like a button
e.preventDefault();
// Get the field name
var quantity = parseInt($('#quantity').val());
var quantity = parseInt( $(this).parent().siblings('input').val() ) ;
// If is not undefined
$('#quantity').val(quantity + 1);
// $('#quantity').val(quantity + 1);
$(this).parent().siblings('input').val(quantity + 1)
// Increment
@ -21,13 +24,13 @@ var quantitiy=0;
// Stop acting like a button
e.preventDefault();
// Get the field name
var quantity = parseInt($('#quantity').val());
var quantity = parseInt( $(this).parent().siblings('input').val() ) ;
// If is not undefined
// Increment
if(quantity>0){
$('#quantity').val(quantity - 1);
$(this).parent().siblings('input').val(quantity - 1);
}
});

Loading…
Cancel
Save