Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5975927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:09:19+00:00 2026-05-22T21:09:19+00:00

Im currently diving into jquery autocomplete for the first time. To start off with,

  • 0

Im currently diving into jquery autocomplete for the first time. To start off with, I had a .net handler calling out to a mssql db and pulling last names. That worked great.

However when I try to add additional values it simply doesnt work. The code being used in the handler is as follows.

    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
    Dim prefixText As String = context.Request.QueryString("term")

    Dim conn As SqlConnection = New SqlConnection
    conn.ConnectionString = ConfigurationManager.AppSettings("CDBPath")

    Dim cmd As SqlCommand = New SqlCommand
    cmd.CommandText = ("Select Ebase.EbLastname, Ebase.EbFirstname, Ejob.EjTitle, Ebase.EbClock " + _
                        "From Ebase " + _
                        "INNER Join Ejob " + _
                        "ON Ebase.EbFlxID = Ejob.EjFlxIDEb " + _
                        "Where Ebase.EbLastname LIKE @SearchText + '%'" + _
                        "And Ebase.EbDateEnd Is Null " + _
                        "And Ejob.EjDateEnd Is Null")

    cmd.Parameters.AddWithValue("@SearchText", prefixText)
    cmd.Connection = conn

    Dim sb As StringBuilder = New StringBuilder
    conn.Open()
    Dim sdr As SqlDataReader = cmd.ExecuteReader

    While sdr.Read
        sb.Append(sdr("EbLastname")).Append(", ").Append(sdr("EbFirstname")).Append(" - ").Append(sdr("EjTitle")).Append(", ").Append(sdr("EbClock")).Append(Environment.NewLine)
    End While
    conn.Close()
    context.Response.ContentType = "application/json"
    context.Response.Write(sb.ToString)

End Sub

I didnt include the IsReusable when posting, but that is there. Is there something really simple that I’m missing in why it doesnt like multiple values but will display one lone value?

** Edit ** To clarify, I just looked in Firebug and it is getting a response but just not displaying it. My implementation of this is pretty simple so far, nothing to fancy.

        $(function() {
        $('#lastName').autocomplete
        ({
            source: "FormAutoComplete.ashx",
            minChars: 3

        });
    })
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:09:20+00:00Added an answer on May 22, 2026 at 9:09 pm

    If you’re returning multiple values you have to monkey with the parsing and formatting of the item. Here’s an example of what I’ve done in the past. It returns a json object like this:

    { City: "Charleston", State: "SC", Code: "chs" }
    

    and formats it into Charleston, SC and uses the Code for the actual value that gets displayed in the textbox.

    $areas.autocomplete(data, {
                formatItem: function (item) {
                    return item.City + ", " + item.State;
                },
                formatResult: function (item) {
                    return item.Code;
                },
                multiple: true
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently diving into the inner workings of .net, which means IL. As an
Greetings, people. I'm diving into Objective-C for pretty much the first time. It's kicking
I'm diving into Rails for the first time and I'm creating a Rails 3
I recently started diving into low level OS programming. I am (very slowly) currently
One of the biggest issues currently holding me back from diving full steam into
I'm currently diving into node.js stuff starting with very simple examples. The following code
I'm diving into 3d programming a bit and am currently learning by writing a
I'm diving into CSS in an effort to be more well-rounded. I'm currently reading
I am currently building an object model for HL7 messages. Without diving into those,
I'm a person that learns best from example. Currently, I'm diving into the field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.