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 716483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:18:16+00:00 2026-05-14T05:18:16+00:00

I’m trying to use the autocomplete plugin for jQuery (this one http://docs.jquery.com/Plugins/Autocomplete ). My

  • 0

I’m trying to use the autocomplete plugin for jQuery (this one http://docs.jquery.com/Plugins/Autocomplete). My server is returning JSON string, which I’m trying to process on the client via AutoComplete plugin’s ‘parse‘ and ‘formatItem‘ parameters, like so:

$(document).ready(function()
{
    $('.searchBox input.textbox').autocomplete('/DoSearch.aspx',
    {
        mustMatch: false,
        autoFill: true,
        minChars: 1,
        dataType: 'json',
        parse: function(data)
        {
            var array = new Array();
            for (var i = 0; i < data.length; i++)
            {
                array[array.length] = { data: data[i], value: data[i].ID, result: data[i].ID };
            }
            return array;
        },
        formatItem: function(row, i, n)
        {
            return row.ID + ': ' + row.Title;
        }
    });
});

When I run this I get a ‘sValue.substring is not a function‘ error thrown in Firebug. However, if I stick breakpoints on formatItem and parse function, they are hit as expected and contain valid data it seems.

Here is an exact copy ‘n’ paste of the JSON text that gets returned from the server:

[{"ID":140177,"Title":"Food Handling","Code":"J01.576.423.200"},{"ID":140178,"Title":"Food Handling","Code":"J01.576.423.200"},{"ID":140179,"Title":"Brain Infarction","Code":"C10.228.140.300.301.200"},{"ID":140180,"Title":"Cerebral Hemorrhage","Code":"C10.228.140.300.535.200"},{"ID":140182,"Title":"Insulin","Code":"D06.472.610.575"},{"ID":140183,"Title":"Insulin","Code":"D06.472.610.575"},{"ID":140184,"Title":"Insulin","Code":"D06.472.610.575"},{"ID":140186,"Title":"Insulin","Code":"D06.472.610.575"},{"ID":140188,"Title":"Insulin","Code":"D06.472.610.575"},{"ID":140189,"Title":"Sulfonylurea Compounds","Code":"D02.886.590.795"}]

Please help, I’ve already searched Google and StackOverflow for help, but can’t find anyone having else this error, cheers!

  • 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-14T05:18:16+00:00Added an answer on May 14, 2026 at 5:18 am

    Dammit!!!

    I found the cause of the problem. It’s because my ID value in my JSON string was typed as a Integer rather than a String eg: {"ID":140177, instead of {"ID":"140177", and AutoComplete assumes everything is going to be a string.

    I fixed the problem by wrapping quotes around the ID value on the server, or just convert it into a string clientside in the ‘parse’ function like so: value: data[i].ID + '', result: data[i].ID + ''

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 378k
  • Answers 378k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There are many ways to skin this cat. One, off… May 14, 2026 at 9:09 pm
  • Editorial Team
    Editorial Team added an answer Use the PHP command line interface which is not subject… May 14, 2026 at 9:09 pm
  • Editorial Team
    Editorial Team added an answer If you look in the source, I bet you see… May 14, 2026 at 9:09 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.