function RPTcalculateCost()
{
var a = document.getElementById("ctl00$ContentPlaceHolder1$IR$ctl00$rptJobDetails$ctl01$txtRate");
var b = document.getElementById("ctl00$ContentPlaceHolder1$IR$ctl00$rptJobDetails$ctl02$txtHours");
var c = document.getElementById("ctl00$ContentPlaceHolder1$IR$ctl00$rptJobDetails$ctl02$txtCost");
if (b.value == '')
{
c.value = 0;
}
else
{
c.value = parseFloat(a.value) * parseFloat(b.value);
}
}
<td colspan="2" style="height: 19px">
<asp:Panel runat="server" ID="pnlJobDetails" DefaultButton="btnHidSave">
<asp:Repeater ID="rptJobDetails" runat="server">
<HeaderTemplate>
<table class="CostBox" width="100%">
<tr>
<td align="left" style="width: 80px; height: 24px"> Staff</td>
<td align="left" style="width: 95px; height: 24px">Staff type</td>
<td align="left" style="width: 55px; height: 24px">Hourly rate</td>
<td align="left" style="width: 35px; height: 24px">Available hours</td>
<td align="left" style="width: 85px; height: 24px">Cost</td>
<td style="height: 24px" > </td>
</tr>
<tr><td colspan="6"></td></tr>
</table>
<div style="height: 200px; overflow: auto;">
<table class="text" width="100%">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr><td>
<div class="os" style="width:80px;overflow:hidden;border-right:1px solid gray">
<asp:DropDownList runat="server" ID="ddlStaff" Enabled="false" Font-Size="XX-Small" Width="180px"></asp:DropDownList>
</div></td>
</tr></table>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<tr><td>
<div class="os" style="width:80px;overflow:hidden;border-right:1px solid gray">
<asp:DropDownList runat="server" ID="ddlStaffType2" Font-Size="XX-Small" Width="230px" AutoPostBack="true"></asp:DropDownList>
</div></td>
<td><img src="../images/arrow.jpg" /></td></tr></table>
</td>
<td><asp:TextBox runat="server" CssClass="costbox" ID="txtRate" Width="55px" Font-Size="XX-Small" OnKeyUp="javascript:RPTcalculateCost();" Text= <%# DataBinder.Eval(Container.DataItem, "HourlyRate")%>></asp:TextBox></td>
<td><asp:TextBox runat="server" CssClass="textbox2" ID="txtHours" Width="35px" Font-Size="XX-Small" OnKeyUp="javascript:RPTcalculateCost();" Text= <%# DataBinder.Eval(Container.DataItem, "AvailableHours")%> ></asp:TextBox></td>
<td><asp:TextBox runat="server" CssClass="costbox" ID="txtCost" Width="75px" Font-Size="XX-Small" Text= <%# DataBinder.Eval(Container.DataItem, "Cost")%> ></asp:TextBox></td>
<td><asp:TextBox runat="server" CssClass="textbox2" ID="intCount" Visible="false" Width="1px" Font-Size="XX-Small" Text= <%# DataBinder.Eval(Container.DataItem, "interventionCount")%> ></asp:TextBox></td>
<td><asp:Button runat="server" ID="btnDelete" Width="18px" Height="18px" CssClass="button" Text="X" ForeColor=red Font-Bold=true CommandArgument= <%# DataBinder.Eval(Container.DataItem, "ID") %> /></td>
<td><asp:Button runat="server" ID="btnSave" Height="18px" Width="28px" CssClass="button" Text="Save" Font-Size="10px" ToolTip="Save changes" ForeColor="green" Font-Bold="true" CommandArgument= <%# DataBinder.Eval(Container.DataItem, "ID") %> CommandName="save" /></td>
<td><asp:Button runat="server" ID="btnPrintDetail" Width="18px" Height="18px" CssClass="button" Text="?" ForeColor=DarkBlue Font-Bold=true ToolTip="Print details" CommandArgument= <%# DataBinder.Eval(Container.DataItem, "ID") %> CommandName="print" BackColor="LightBlue" Font-Names="Tahoma" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table></div>
</FooterTemplate>
</asp:Repeater>
</asp:Panel>
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.