<script language="javascript">
   function chg()
       { 
var quantity = document.all.quantity
  for(i=0;i<quantity.length;i++){
document.all.refund[i].value=parseFloat(document.all.buy_price[i].value) * parseFloat(document.all.quantity[i].value);
document.all.total.value=parseFloat(document.all.refund[i].value);}
}
</script>

解决方案 »

  1.   

    javascript的问题怎么发到这里来了? 斑竹呢 不管管?
      

  2.   

    <script language="javascript">
    function chg() { 
        var quantity = document.all.quantity;
        var total = 0;
        for (var i = 0; i< quantity.length; i++) {
            var temp = 
                parseFloat(document.all.buy_price[i].value) * 
                parseFloat(quantity[i].value);
            document.all.refund[i].value = temp;
            total += temp;
        }  
        document.all.total.value = total;
    }
    </script>