Microsoft JScript runtime error: Object expected

  •  07-28-2008, 6:03 AM

    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
View Complete Thread