fixed the numeric picker

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

@ -1,36 +1,39 @@
$(document).ready(function(){ $(document).ready(function(){
var quantitiy=0; var quantitiy=0;
$('.quantity-right-plus').click(function(e){ $('.quantity-right-plus').click(function(e){
// Stop acting like a button // Stop acting like a button
e.preventDefault(); e.preventDefault();
// Get the field name // Get the field name
var quantity = parseInt($('#quantity').val()); var quantity = parseInt( $(this).parent().siblings('input').val() ) ;
// If is not undefined // If is not undefined
$('#quantity').val(quantity + 1);
// Increment // $('#quantity').val(quantity + 1);
}); $(this).parent().siblings('input').val(quantity + 1)
$('.quantity-left-minus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var quantity = parseInt($('#quantity').val());
// If is not undefined // Increment
});
$('.quantity-left-minus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var quantity = parseInt( $(this).parent().siblings('input').val() ) ;
// Increment // If is not undefined
if(quantity>0){
$('#quantity').val(quantity - 1);
}
});
// Increment
if(quantity>0){
$(this).parent().siblings('input').val(quantity - 1);
}
});
}); });
function submitOrder(){ function submitOrder(){

Loading…
Cancel
Save