JavaScript Error Message on IE10

2 posts, 0 answers
  1. Anthony
    Anthony avatar
    24 posts
    Member since:
    Oct 2013

    Posted 07 Nov 2014 Link to this post

    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>
  2. Anthony
    Anthony avatar
    24 posts
    Member since:
    Oct 2013

    Posted 07 Nov 2014 in reply to Anthony Link to this post

    I'm so stupid...I figure it out. Just realize that I need to call it "timesValues" and not "timesValues()".  
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top