日期:2014-05-16  浏览次数:20372 次

有5个输入框,对前4个输入框输入的数字进行自动累加并自动赋值到第五个输入框内。我已经调试成功程序,但发生了很奇怪的事情,盼大神解惑!
本帖最后由 u011552243 于 2013-10-31 21:06:59 编辑
直接上代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>test.html</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script> 
            <script src="js/cufon-yui.js" type="text/javascript"></script>
    <script src="js/Arial_Rounded_MT_300.font.js" type="text/javascript"></script>
       <script src="js/jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){                 
                var v1 = 0;
                var v2 = 0;
                var v3 = 0;
                var v4 = 0;
                   
                $("#add_1").keyup(function(){
                    v1 = $(this).val();
                    if(v1 == ''){
                        return false;
                    }else{
                        var result=0;
                        result=(parseFloat(v1)*0.0316).toFixed(2);
                     $("#add_2").val(result);
                     v2 == $("#add_2").val();
                    
                    v3 = $("#add_3").val();
                    v4 = $("#add_4").val();

                    if&nbs