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

如何实现回车是指定文本框数值相加,结果放入另一文本框
JScript code

<body>

<form id="newForm" name="newForm">

<table width="90%" align="center" class="t1" border="1" cellspacing="0" cellpadding="0" id='newtable'>

<tr>

<td nowrap="nowrap" align="center"><font size="2"><input type="text" id="zhag_gccllj" name="zhag_gccllj"
                                                             value="<fmt:formatNumber value="${InputWuhuDate.zhag_gccllj+0.0001}" pattern="0.00" minFractionDigits="2" />"
                                                             onafterpaste="value=value.replace(/[^\d\.]/g,'')"
                                                             style="width:80px;text-align:right"
                                                             onfocus="javascript:this.select();"
                                                             onblur="on_blur(this.value,this.id)"
                                                             onkeyup="on_keypress('zhag_ccl');"
                                                             onkeydown="add()"
                                                             ></font>
    </td>

    <td nowrap="nowrap" align="center"><font size="2"><input type="text" id="zhag_ccllj" name="zhag_ccllj"
                                                             value="<fmt:formatNumber value="${InputWuhuDate.zhag_ccllj+0.0001}" pattern="0.00" minFractionDigits="2" />"
                                                             onafterpaste="value=value.replace(/[^\d\.]/g,'')"
                                                             style="width:80px;text-align:right"
                                                             onfocus="javascript:this.select();"
                                                             onblur="on_blur(this.value,this.id)"
                                                             onkeyup="on_keypress('zhag2_gccl');"
                                                             onkeydown="add()"
                                                             ></font>
    </td>

    <td nowrap="nowrap" align="center"><font size="2"><input type="text" id="zhag2_gccllj" name="zhag2_gccllj"
                                                             value="<fmt:formatNumber value="${InputWuhuDate.zhag2_gccllj+0.0001}" pattern="0.00" minFractionDigits="2" />"
                                                             onafterpaste="value=value.replace(/[^\d\.]/g,'')"
                                                             style="width:80px;text-align:right"
                                                             onfocus="javascript:this.select();"
                                                             onblur="on_blur(this.value,this.id)"
                                                             onkeyup="on_keypress('zhag2_ccl');"
                                                             onkeydown="add()"
                                                             ></font>
    </td>

    <td nowrap="nowrap" align="center"><font size="2"><input type="text" id="zhag2_ccllj" name=&quo