Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Autosuggest Text box code gives "Object Expected"

Autosuggest Text box code gives "Object Expected"

Scheduled Pinned Locked Moved Web Development
javascripthtmlhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bubberz
    wrote on last edited by
    #1

    Hello! I'm trying to use the Autocomplete for the AjaxPro.dll from: http://munich.schwarz-interactive.de/autocomplete.aspx I keep getting "Object Expected" in my javascript on my .js include file along with that in the HTML body. I've added this to my web.config file: ********** ********** My code behind is trying to return names from my table (for starters) so I can see the names with the autosuggest: _ Public Function SearchAdvanced(ByVal orderNumber As String, ByVal customerID As Integer, ByVal count As Integer) As DataTable Dim ds As DataSet = New DataSet Dim sCon1 As New SqlConnection sCon1.ConnectionString = Session("DBDDL") Dim cmd As New SqlCommand("SELECT Authority FROM Signature_Authority_Names WHERE Authority like @CustomerID") '+ '"AND OrderNumber LIKE @OrderNumber " + '"ORDER BY OrderNumber, PartNumber, JobNumber", conn) cmd.Parameters.Add("@CustomerID", customerID) 'cmd.Parameters.Add("@OrderNumber", orderNumber + "%") Try sCon1.Open() Try Dim da As SqlDataAdapter = New SqlDataAdapter(cmd) da.Fill(ds) Finally sCon1.Close() End Try Catch Return Nothing End Try 'Return ds.Tables Return ds.Tables(0) End Function ********** ********** My HTML is: //Code for Autocomplete function init() { var x = new MS.Web.AutoCompleteDataTable("searchCustomerID", 10); x.getDisplay = function(item) { return (item != null ? item.Authority : ""); } x.getValue = function(item) { return (item != null ? item.Authority.toString().trimRight() : ""); } x.getData = function() { Namespace.ClassName.AjaxMethod(this.ele.value, this.count, this.callback.bind(this)); } } addEvent(window, "load", init); //error received on this line //End Code for Autocomplete

    ....I get an error on the line for addEvent(window, "load", init); saying "Object Expected" ***

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups