This is a migrated thread and some comments may be shown as answers.

JavaScript Error Message on IE10

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 07 Nov 2014, 03:23 PM
Hi Everyone,
I've decided to start using javascript to do some client side math instead of doing it behind code.  I started to test it out with the below page. It work but before updating RadNumericTextBox3, it throw an error message "Error: Object expected".  I look into the  browser developer tool and it throw this code "t[r](n,i)". Just to point out, Firefox and Chrome didn't display the error but when I look in the developer tool, I see the same code ""t[r](n,i)".  What am I doing wrong? How can I fix it?  PS: the radscriptmanager is in the masterpage.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="JavaScriptTextBox.aspx.cs" Inherits="TBSWeb.Lab.JavaScriptTextBox" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function timesValues() {
            var radTextBox1 = $find("<%= RadNumericTextBox1.ClientID %>");
            var radTextBox2 = $find("<%= RadNumericTextBox2.ClientID %>");
            var radTextBox3 = $find("<%= RadNumericTextBox3.ClientID %>");
                if (radTextBox1.get_value() != "" || radTextBox2.get_value() != "") {
                    var total = radTextBox1.get_value() * radTextBox2.get_value();
                    radTextBox3.set_value(total);
                }
            
 
        }
     
    </script>
    </telerik:RadCodeBlock>
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server">
    </telerik:RadNumericTextBox>
    <telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server">
    </telerik:RadNumericTextBox>
    <telerik:RadNumericTextBox ID="RadNumericTextBox3" runat="server">
    </telerik:RadNumericTextBox>
    <telerik:RadButton ID="btnCalculate" runat="server" Text="Calculate" OnClientClicked="timesValues()">
    </telerik:RadButton>
</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Anthony
Top achievements
Rank 1
answered on 07 Nov 2014, 03:39 PM
I'm so stupid...I figure it out. Just realize that I need to call it "timesValues" and not "timesValues()".  
Tags
General Discussions
Asked by
Anthony
Top achievements
Rank 1
Answers by
Anthony
Top achievements
Rank 1
Share this question
or