
Originally Posted by
preluvbags
Yes, that's correct. DPU is working as intended and there isn't any js error; no other js has been added till yet.
Ok, so went and reproduced the code/situation. While there may still be a better way to implement this, what I did that worked was to instead modify the javascript code like so:
Code:
$(document).ready(function() {
var chkqty = $('#addqty').val();
$("#button-minus").click(function(){
var addqty = $('#addqty').val();
if(parseInt(addqty)>1) {
var newval = parseInt(addqty) - 1;
$('#addqty').val(newval);
try {
init();
} catch (call_err) {
console.log(call_err.stack);
}
return true;
}else{
return false;
}
});
$('#button-plus').click(function(){
var addqty = $('#addqty').val();
var newval = parseInt(addqty) + 1;
$('#addqty').val(newval);
try {
init();
} catch (call_err) {
console.log(call_err.stack);
}
return true;
});
});
This worked for me and would update after every increase/decrease made by clicking the + or -.