求服務(wù)器端函數(shù)可以生成客戶端JS代碼并完成如下任務(wù):
指定任意兩個(gè)或三個(gè)textbox,在這兩個(gè)或三個(gè)textbox中輸入數(shù)字時(shí),自動(dòng)計(jì)算相乘的結(jié)果,并在另外的一個(gè)textbox中顯示計(jì)算的值。當(dāng)相乘幾個(gè)textbox中有空著的時(shí)候,不顯示計(jì)算值。
指定任意的n個(gè)textbox,自動(dòng)計(jì)算其總和,顯示在另外的一個(gè)textbox中。當(dāng)前面幾個(gè)textbox中的值改變時(shí),自動(dòng)更新總和。
界面如下所示:所有紅框處,最后的textbox自動(dòng)計(jì)算前面幾個(gè)的乘積。所有藍(lán)框的地方求和顯示在最后一個(gè)textbox中。
注意:自動(dòng)計(jì)算過(guò)程不能有postback。
在線等。當(dāng)天有效。第一個(gè)能完美解決問(wèn)題的300元通過(guò)網(wǎng)上銀行轉(zhuǎn)賬付款。
頁(yè)面代碼如下:
<table rules="all" border="1" cellspacing="0" > <tr> <td colspan="6" align="center"><strong>外出人員費(fèi)用</strong></td> </tr> <tr> <td>往返里程</td> <td align="right"><asp:TextBox ID="txtWangFanLiCheng" runat="server" Width="50px"></asp:TextBox>km </td> <td>人數(shù)</td> <td align="right"> <asp:TextBox ID="txtRenShu" runat="server" Width="50px"></asp:TextBox> 個(gè)</td> <td>天數(shù)</td> <td align="right"> <asp:TextBox ID="txtTianShu" runat="server" Width="50px"></asp:TextBox> 天</td> </tr> <tr> <td colspan="2">車船費(fèi)</td> <td colspan="4" align="right"> <asp:TextBox ID="txtCheChuanFei" runat="server" Width="50px"></asp:TextBox> 元</td> </tr> <tr> <td colspan="2">食宿費(fèi)</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">在途工時(shí)補(bǔ)助</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>外出服務(wù)用車費(fèi)用</strong></td> </tr> <tr> <td colspan="2">第一次服務(wù)用車費(fèi)</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">第二次服務(wù)用車費(fèi)</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>修理工時(shí)費(fèi)</strong></td> </tr> <tr> <td>工時(shí)數(shù)(h)</td> <td align="right"> <asp:TextBox ID="txtGongShiShu" runat="server" Width="50px"></asp:TextBox> 小時(shí)</td> <td>節(jié)假日上浮比例</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>工時(shí)費(fèi)</td> <td colspan="5" align="right">(基本工時(shí))<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>舊件運(yùn)費(fèi)</td> <td align="right"> <asp:TextBox ID="txtJiuJianYunFei" runat="server" Width="50px"></asp:TextBox> 元</td> <td colspan="2">其他費(fèi)用</td> <td colspan="2" align="right"> <asp:TextBox ID="txtQiTaFeiYong" runat="server" Width="50px"></asp:TextBox> 元</td> </tr> <tr> <td>費(fèi)用合計(jì)</td> <td colspan="5" align="right"> <asp:TextBox ID="txtFeiYongHeJi" runat="server" Width="50px"></asp:TextBox> 元</td> </tr></table>
300RMB求JS代碼
元芳怎么了
2018-12-07 06:42:31