求服务器端函数可以生成客户端JS代码并完成如下任务:
指定任意两个或三个textbox,在这两个或三个textbox中输入数字时,自动计算相乘的结果,并在另外的一个textbox中显示计算的值。当相乘几个textbox中有空着的时候,不显示计算值。
指定任意的n个textbox,自动计算其总和,显示在另外的一个textbox中。当前面几个textbox中的值改变时,自动更新总和。
界面如下所示:所有红框处,最后的textbox自动计算前面几个的乘积。所有蓝框的地方求和显示在最后一个textbox中。
注意:自动计算过程不能有postback。
在线等。当天有效。第一个能完美解决问题的300元通过网上银行转账付款。

页面代码如下:
<table rules="all" border="1" cellspacing="0" >
<tr>
<td colspan="6" align="center"><strong>外出人员费用</strong></td>
</tr>
<tr>
<td>往返里程</td>
<td align="right"><asp:TextBox ID="txtWangFanLiCheng" runat="server"
Width="50px"></asp:TextBox>
km </td>
<td>人数</td>
<td align="right">
<asp:TextBox ID="txtRenShu" runat="server"
Width="50px"></asp:TextBox>
个</td>
<td>天数</td>
<td align="right">
<asp:TextBox ID="txtTianShu" runat="server"
Width="50px"></asp:TextBox>
天</td>
</tr>
<tr>
<td colspan="2">车船费</td>
<td colspan="4" align="right">
<asp:TextBox ID="txtCheChuanFei" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td colspan="2">食宿费</td>
<td colspan="4" align="right">
<asp:TextBox ID="txtShiSuFei_Yuan" runat="server"
Width="50px"></asp:TextBox>
元×<asp:TextBox ID="txtShiSuFei_Ren" runat="server"
Width="50px"></asp:TextBox>
人× <asp:TextBox ID="txtShiSuFei_Tian" runat="server"
Width="50px"></asp:TextBox>
天=<asp:TextBox ID="txtShiSuFei_Zong" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td colspan="2">在途工时补助</td>
<td colspan="4" align="right">
<asp:TextBox ID="txtZaiTuGongShiBuZhu_Yuan" runat="server"
Width="50px"></asp:TextBox>
元×<asp:TextBox ID="txtZaiTuGongShiBuZhu_Ren" runat="server"
Width="50px"></asp:TextBox>
人=<asp:TextBox ID="txtZaiTuGongShiBuZhu_Zong" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td colspan="6" align="center"><strong>外出服务用车费用</strong></td>
</tr>
<tr>
<td colspan="2">第一次服务用车费</td>
<td colspan="4" align="right">
<asp:TextBox ID="txtDiYiCiYongCheFei_Yuan" runat="server"
Width="50px"></asp:TextBox>
元/Km×
<asp:TextBox ID="txtDiYiCiYongCheFei_LiCheng" runat="server"
Width="50px"></asp:TextBox>
Km=
<asp:TextBox ID="txtDiYiCiYongCheFei_Zong" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td colspan="2">第二次服务用车费</td>
<td colspan="4" align="right">
<asp:TextBox ID="txtDiErCiYongCheFei_Yuan" runat="server"
Width="50px"></asp:TextBox>
元/Km×
<asp:TextBox ID="txtDiErCiYongCheFei_LiCheng" runat="server"
Width="50px"></asp:TextBox>
Km=<asp:TextBox ID="txtDiErCiYongCheFei_Zong" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td colspan="6" align="center"><strong>修理工时费</strong></td>
</tr>
<tr>
<td>工时数(h)</td>
<td align="right">
<asp:TextBox ID="txtGongShiShu" runat="server"
Width="50px"></asp:TextBox>
小时</td>
<td>节假日上浮比例</td>
<td align="right">
<asp:TextBox ID="txtJieJiaRiShangFuBiLi" runat="server"
Width="50px"></asp:TextBox>
%</td>
<td>高寒上浮比例</td>
<td align="right">
<asp:TextBox ID="txtGaoHanShangFuBiLi" runat="server"
Width="50px"></asp:TextBox>
%</td>
</tr>
<tr>
<td>工时费</td>
<td colspan="5" align="right">(基本工时)<asp:TextBox
ID="txtGongShiFei_Yuan" runat="server"
Width="50px"></asp:TextBox>
元×<asp:TextBox ID="txtGongShiFei_H" runat="server"
Width="50px"></asp:TextBox>
h×<asp:TextBox ID="txtGongShiFei_BiLi" runat="server"
Width="50px"></asp:TextBox>
%=<asp:TextBox ID="txtGongShiFei_Zong" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td>旧件运费</td>
<td align="right">
<asp:TextBox ID="txtJiuJianYunFei" runat="server"
Width="50px"></asp:TextBox>
元</td>
<td colspan="2">其他费用</td>
<td colspan="2" align="right">
<asp:TextBox ID="txtQiTaFeiYong" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
<tr>
<td>费用合计</td>
<td colspan="5" align="right">
<asp:TextBox ID="txtFeiYongHeJi" runat="server"
Width="50px"></asp:TextBox>
元</td>
</tr>
</table>