I Have 4 text boxes namely customer_phy_tot
, customer_che_tot
, customer_bio_tot
. I'm trying to add and display all 3 input boxes values to a 4th input, customer_pcb_tot
.
customer_bio_obt.blur(function(){
var customer_pcb_tot = isNaN(parseInt($("#customer_phy_tot").val() + $("#customer_che_tot").val() + $("#customer_bio_tot").val())) ? 0 :( $("#customer_phy_tot").val() + $("#customer_che_tot").val() + $("#customer_bio_tot").val())
$("#customer_pcb_tot").val(customer_pcb_tot);
});
The problem is instead of adding my code is treating it as a string. Suppose I have values 10
, 15
and 5
respectively. It's supposed to display 30
in the 4th box but in my case it is showing 10155
.
Any help greatly appreciated.