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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:33:23+00:00 2026-05-30T10:33:23+00:00

I have a Jquery autocomplete ajax function whose source is calculated from code behind.

  • 0

I have a Jquery autocomplete ajax function whose source is calculated from code behind. however I am getting the source in javascript using client script manager but my function doesn’t execute.

Apart from that I am trying to call that ajax function from code behind through

ClientScriptManager.RegisterStartupScript()

But again my function doesn’t execute.
My function is:

<form id="form1" runat="server">
    <div>
        <input id="Text1" type="text"/>&nbsp;&nbsp;&nbsp;
        <input id="Text2" type="text" /><br />
        <br />
        <input id="Button2" type="button" value="button" />

    <script type="text/javascript">
    var mydataformat = [{ label: "....", value: "....", icon: "....." }, 
                        { label: "....", value: ".....", icon: "....." }];

    $(function() {
    $("#Text1").autocomplete({                      
    minLength: 0,                      
    source: JSVar,                      
    focus: function (event, ui) 
    {
    $("#Text1").val(ui.item.label);                          
    return false;                      
    }})                     
    .data("autocomplete")._renderItem = function (ul, item) {                         
    return $("<li></li>") 
    .data("item.autocomplete", item)                             
    .append("<a><img src='" + item.icon + "' width='32' height='32' />  " + item.label + "</a>")                             
    .appendTo(ul);                     
        }; 
    });

</script>
  • 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-30T10:33:24+00:00Added an answer on May 30, 2026 at 10:33 am

    You have to set the source when your data has been loaded like mentioned here:

    $("#Text1").autocomplete( "option", "source", ["your", "loaded", "data"] );
    

    …or better initialize your autocomplete when your calculated data is ready, not earlier.

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

Sidebar

Related Questions

I am using a JQuery autocomplete AJAX plugin as follows; $(document).ready(function() { $(#myfield).autocomplete({ serviceUrl:'autocomplete.asp?soc='
I now have a working JavaScript autocomplete function, thanks to help from many of
I am implementing the Jquery UI autocomplete. I have the following code. Application.js $(function()
The below code is very simple. I have a jQuery autocomplete bound to an
I have a IHttpHandler that acts as a source to a jQuery Autocomplete input
I'm using 'rails3-jquery-autocomplete' gem, but it doesn't have multi column search, but there is
I am using the jQuery autocomplete plugin and have wired up an input field
I have this jquery ajax code that submits my form if it gets changed.
I have a test server with a page using jquery autocomplete. The autocomplete feature
I have just built a custom autocomplete component using jquery. My problem is that

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.