swerjuseate
New Member
I am having difficult displaying the contents of a variable in a total input field. Basically this code is functioning which is great:\[code\]$(function() {$('#product-unit-val, #total-unit-sales, #number-reps').change(function() {var total = parseInt($("#product-unit-val").val()) * parseInt($("#total-unit- sales").val()) * parseInt($("#number-reps").val());if (!isNaN(total)) { $("#sales-val").html(total);}});});Average product unit value <input type="text" id="product-unit-val" /><br/>Total unit sales value <input type="text" id="total-unit-sales" /><br/>Number of reps <input type="text" id="number-reps" /><br/>Total sales value <span id="sales-val"></span>$???\[/code\]However I want to display the total value in an input field like:\[code\]$(function() {$('#product-unit-val, #total-unit-sales, #number-reps').change(function() {var total = parseInt($("#product-unit-val").val()) * parseInt($("#total-unit- sales").val()) * parseInt($("#number-reps").val());if (!isNaN(total)) { $("#sales-val").html(total);}});});Average product unit value <input type="text" id="product-unit-val" /><br/>Total unit sales value <input type="text" id="total-unit-sales" /><br/>Number of reps <input type="text" id="number-reps" /><br/>Total sales value <input type ="text" id="sales-val"/>?\[/code\]Am I missing the obvious? I just can't seem to get this working.Many Thanks