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

  • SEARCH
  • Home
  • 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 9064115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:10:01+00:00 2026-06-16T16:10:01+00:00

I am trying to bind the text box and the JQuery AutoComplete feature. When

  • 0

I am trying to bind the text box and the JQuery AutoComplete feature. When I checked the Firebug AJAX Request & Response it returns like the following. But the textbox is not showing any items. Could you please advise me, what I am doing wrong? Thanks.

enter image description here
Here is my coding:

$("#<%= TextBox1.ClientID %>").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "/contractors/web_services/wsSM.asmx/SearchDrugs",
                    type: "POST",
                    dataType: "json",
                    data: {
                        'LocationID': "10543",
                        'Search': request.term
                    },
                    success: function (data) {                        
                        response($.map(data.d, function (item) {

                            return {
                                value: item.FullDrugName,
                                id: item.DrugID
                            }
                        }))
                    }
                });
            },
            delay: 1,
            minLength: 2,
            select: function (event, ui) {
                alert(ui.item.id);
            }
        });
  • 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-06-16T16:10:03+00:00Added an answer on June 16, 2026 at 4:10 pm

    In addition to @fealin’s answer, you’re going to need to change the way you process the xml response. It doesn’t look like you have a d property on the return data, and you also need to look for the correct nodes in the XML structure and pull out their text to build the response array that you return to the widget.

    Based on the XML you’ve provided, it might look something like this:

    $("#<%= TextBox1.ClientID %>").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "/contractors/web_services/wsSM.asmx/SearchDrugs",
                type: "POST",
                dataType: "json",
                data: {
                    'LocationID': "10543",
                    'Search': request.term
                },
                success: function (data) {                        
                    response($(data).find("Drug").map(function (_, el) {
                        var $el = $(el);
                        return {
                            label: $el.find("FullDrugName").text(),
                            value: $el.find("DrugID").text()
                        };
                }));
            });
        },
        delay: 1,
        minLength: 2,
        select: function (event, ui) {
            alert(ui.item.id);
        }
    });
    

    Here’s an example that’s just using the XML string (without an AJAX request): http://jsfiddle.net/J5rVP/29/

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

Sidebar

Related Questions

I'm trying to bind a text box to the count of a filtered, collection
I am trying to bind a CData element to a text box, in code.
I am trying to bind a text box to a dependency property to change
I am trying to bind the Text of a TextBox named 'txtImage' to an
I'm trying to bind a simple one-line string to a textbox's text property but
I have been trying to bind the StringFormat of the Text property of a
I'm trying to create a modal confirmation dialog box. I'd like it to work
I've been trying to add auto complete functionality to a text box. I want
I'm trying to bind a Textbox.Text to Form.Text (which sets the title of the
I'm trying to get bind a textbox text property to an observable collection, and

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.