在所有的分类的框的onchange里写了:(以ID来写)
document.all.totalsum.value = docuemnt.all.total1.value+docuemnt.all.total2.value+...

解决方案 »

  1.   

    我写的,你看看
    <html>
    <body>
    <form name="form1" method="post" action="">
      <p>
        <input name="A1" type="text" id="1" onChange="tot()">
      </p>
      <p> 
        <input name="A2" type="text" id="2" onChange="tot()">
      </p>
      <p>
        <input name="A3" type="text" id="3" >
      </p>
    </form>
    </body>
    </html>
    <Script>
    function tot()
    {
    document.all.A3.value=Number(document.all.A1.value)+Number(document.all.A2.value);
    }
    </Script>