fixed the numeric picker
This commit is contained in:
+31
-28
@@ -1,36 +1,39 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var quantitiy=0;
|
||||
$('.quantity-right-plus').click(function(e){
|
||||
|
||||
// Stop acting like a button
|
||||
e.preventDefault();
|
||||
// Get the field name
|
||||
var quantity = parseInt($('#quantity').val());
|
||||
|
||||
// If is not undefined
|
||||
|
||||
$('#quantity').val(quantity + 1);
|
||||
|
||||
|
||||
// Increment
|
||||
|
||||
});
|
||||
|
||||
$('.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
|
||||
$('.quantity-right-plus').click(function(e){
|
||||
|
||||
// Increment
|
||||
if(quantity>0){
|
||||
$('#quantity').val(quantity - 1);
|
||||
}
|
||||
});
|
||||
// Stop acting like a button
|
||||
e.preventDefault();
|
||||
// Get the field name
|
||||
var quantity = parseInt( $(this).parent().siblings('input').val() ) ;
|
||||
|
||||
// If is not undefined
|
||||
|
||||
// $('#quantity').val(quantity + 1);
|
||||
|
||||
$(this).parent().siblings('input').val(quantity + 1)
|
||||
|
||||
|
||||
// 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() ) ;
|
||||
|
||||
// If is not undefined
|
||||
|
||||
// Increment
|
||||
if(quantity>0){
|
||||
$(this).parent().siblings('input').val(quantity - 1);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function submitOrder(){
|
||||
|
||||
Reference in New Issue
Block a user