onblur    parseInt('单价') * parseInt('数量')

解决方案 »

  1.   

    能写详细点么??或者把下面代码帮忙改改,小弟新手
    <script language="javascript" type="text/javascript">
    function myfun()
    {
       var strOne = document.Form1.TextBox1.value;
       var strTwo = document.Form1.TextBox2.value;
       var strThree = 1*strOne + 1*strTwo;
       Form1.TextBox3.value = strThree;
    }
    </script><body onfocus="myfun()">
    <form id="Form1" method="post" runat="server">
    <INPUT id="TextBox1" type="text" value="0" name="TextBox1">
    <INPUT id="TextBox2" value="0" type="text">
    <INPUT id="TextBox3" type="text" name="Text1">
       </form>
    </body>
      

  2.   


    <script language="javascript" type="text/javascript"> 
    function myfun() 

      var strOne = document.getElementById("TextBox1").value; 
      var strTwo =  document.getElementById("TextBox2").value; 
      var strThree = strOne * strTwo; 
      document.getElementById("TextBox3").value = strThree; 

    </script> <body> 
    <form id="Form1" method="post" runat="server"> 
    <INPUT id="TextBox1" type="text" value="0" name="TextBox1"> 
    <INPUT id="TextBox2" value="0" type="text" > 
    <INPUT id="TextBox3" type="text" name="Text1" onfocus="myfun()" value="正确输入单价 数量请点击"> 
      </form> 
    </body>
      

  3.   

    <script language="javascript" type="text/javascript"> 
    function myfun() 

      var strOne = document.getElementById("TextBox1").value; 
      var strTwo =  document.getElementById("TextBox2").value; 
      var strThree = 1*strOne + 1*strTwo; 
      document.getElementById("TextBox3").value = strThree; 

    </script> <body onfocus="myfun()"> 
    <form id="Form1" method="post"  runat="server"> 
    <INPUT id="TextBox1" type="text" value="0" name="TextBox1"> 
    <INPUT id="TextBox2" value="0"  type="text" > 
    <INPUT id="TextBox3" type="text" name="Text1"  > 
      </form> 
    </body>
    改成这样就不需要点击文本框了,随便点下页面上点下鼠标就计算,但是还是不完美,如何设置成只要鼠标一移动就计算,因为用户不点的话就不会计算,但是用户肯定会移动鼠标的,那就实现自动计算了
      

  4.   

    <body onmouseout="myfun()"> 这样就可以了,我弄出来了