I have a radgrid with editformsetting using 2 ascx files. each has its condition to calculate sum of two textboxes when leaving the textboxes. but I keep getting error like the page is not recognizing the javascript.
| //Calculate the original pages * the copies and input the result to copy quantity |
| var ActualIndex; |
| var index; |
| var txtRadOriginalPages = null; |
| var txtRadCopies = null; |
| var txtRadCopyQty1 = null; |
| function updateTotals(sender, args) { |
| var v1 = txtOriginalPages.get_value(); |
| var v2 = txtCopies.get_value(); |
| var finalValue = parseFloat(v1) * parseFloat(v2); |
| txtRadCopyQty1.set_value(parseFloat(finalValue)); |
| } |
| function setIndex(sender, args) { |
| index = args.get_itemIndexHierarchical(); |
| } |
| function setActualIndex() { |
| ActualIndex = index; |
| } |
| function Load1(sender, args) { |
| txtOriginalPages = sender; |
| } |
| function Load2(sender, args) { |
| txtCopies = sender; |
| } |
| function Load3(sender, args) { |
| txtRadCopyQty1 = sender; |
| } |
| <tr> |
| <td align="left"> |
| <asp:Label ID="lblOriginalPages" runat="server" Text="Original Pages:"></asp:Label> |
| </td> |
| <td align="left"> |
| <telerik:RadNumericTextBox ID="txtRadOriginalPages" runat="server" |
| DbValue='<%# Eval("Orig_Pages" ) %>' Font-Size="11px" Skin="Office2007" |
| NumberFormat-DecimalDigits="0" Type="Number" Width="100px" > |
| <ClientEvents OnValueChanged="updateTotals" OnFocus="setActualIndex" OnLoad="Load1" /> |
| <NumberFormat DecimalDigits="0" /> |
| </telerik:RadNumericTextBox> |
| </td> |
| <td align="left"> |
| <asp:Label ID="lblCopies" runat="server" Text="Copies:"></asp:Label> |
| </td> |
| <td align="left"> |
| <telerik:RadNumericTextBox ID="txtRadCopies" runat="server" |
| DbValue='<%# Eval("Quantity" ) %>' Font-Size="11px" Skin="Office2007" |
| NumberFormat-DecimalDigits="0" Type="Number" Width="100px" > |
| <ClientEvents OnValueChanged="updateTotals" OnFocus="setActualIndex" OnLoad="Load2" /> |
| <NumberFormat DecimalDigits="0" /> |
| </telerik:RadNumericTextBox> |
| </td> |
| </tr> |
| <tr> |
| <td align="left"> |
| <asp:Label ID="lblCopyQty1" runat="server" Text="Copy Quantity 1:"></asp:Label> |
| </td> |
| <td align="left"> |
| <telerik:RadNumericTextBox ID="txtRadCopyQty1" runat="server" |
| DbValue='<%# Eval("Total") %>' Font-Size="11px" Skin="Office2007" Width="100px" |
| NumberFormat-DecimalDigits="0" Type="Number"> |
| <ClientEvents OnLoad="Load3" /> |
| <NumberFormat DecimalDigits="0"></NumberFormat> |
| </telerik:RadNumericTextBox> |
| </td> |
| <td align="left"> |
| <asp:Label ID="lblInkType1" runat="server" Text="Ink Type 1:"></asp:Label> |
| </td> |
| </tr> |
Thank you.
