Microsoft JScript runtime error: Object expected

Last post 07-28-2008, 2:14 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  07-28-2008, 6:03 AM 42575

    Microsoft JScript runtime error: Object expected

    could you help me please I am getting this error Microsoft JScript runtime error: Object expected whenver textbox changed its value .I got this exeception every time i use .js file
    this is my code given below

    function Validate()

    {

    if(document.getElementById("<%=txtTax.ClientID%>").value.length<3)

    {

    alert("Tax Must Be 3 Characters");

    document.getElementById ("<%=txtTax.ClientID%>").focus();

    return false;

    }

    return true;

    }
     and then i use
     

    If Not IsPostBack Then

    txtTax.Attributes.Add("onchange", "Validate()")
     
    End If
     
    source code is

     

    <%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/MasterPage.master" CodeFile="New_Customer_Details.aspx.vb" Inherits="Customer_New_Customer_Details" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolder2" ID="Content2" runat="server">

    <script type="text/javascript" src="../Script/JScript.js"></script>

    -----
     

    But i am gettin Microsoft JScript runtime error: Object expectedexception

    what is this exception and how can i over come?

    thanks in advance
  •  07-28-2008, 2:14 PM 42582 in reply to 42575

    Re: Microsoft JScript runtime error: Object expected

    Where did you get this error message?
     
    Before or after the alert?

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML