<script>
$(document).ready(function(){
var quantitiy=0;
$('.txtQua-right-plus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var txtQua = parseInt($('#txtQua').val());
// If is not undefined
$('#txtQua').val(txtQua + 1);
// Increment
});
$('.txtQua-left-minus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var txtQua = parseInt($('#txtQua').val());
// If is not undefined
// Increment
if(txtQua>0){
$('#txtQua').val(txtQua - 1);
}
});
});
</script>
<button type="button" class="txtQua-left-minus btn btn-danger btn-number"
data-type="minus" data-package="<?=$packing?>"><span class="glyphicon glyphicon-minus"></span></button>
<input type="text" id="txtQua<?=$strNum;?>" name="txtQua[]" class="span1 form-control input-number" placeholder="1" min="1" max="100" value="<?=$_SESSION["strQuanlity"]["$i"];?>" maxlength="6" readonly>
<button type="button" class="txtQua-right-plus btn btn-success btn-number"
data-type="plus" data-package="<?=$packing?>"><span class="glyphicon glyphicon-plus"></span></button>
<script>
$(document).ready(function(){
var quantitiy=0;
$('.txtQua-right-plus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var txtQua = parseInt($('#txtQua').val());
// If is not undefined
$('#txtQua').val(txtQua + parseInt($(this).data('package')) );
// Increment
});
$('.txtQua-left-minus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var txtQua = parseInt($('#txtQua').val());
// If is not undefined
// decrement
if(txtQua>0){
$('#txtQua').val(txtQua - $(this).data('package') );
}
});
});
</script>