I have multiple selects that populate form with products and prices. Then I am calculating full price of all products and that works fine but there is number input field in form for quantity and I cant calculate price based on products quantity.
Here is fiddle: http://jsfiddle.net/fpm971fb/
I tried with this code:
jQuery('input.selected-product-quantity').bind('focus blur select change click dblclick mousedown mouseup mouseover mousemove mouseout keypress keydown keyup', function(){
pr=jQuery('.priceClass').text();
nr=jQuery('.selected-product-quantity').val();
calc=pr*nr;
console.log(pr+"*"+nr);
jQuery('.priceClass').html(calc);
});
But when this code is entered inside on change function (see in fiddle) it shows huge numbers like it adds one to another. And when its outside that function then nothing happens.
How can I properly calculate full price with quantity?