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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:09:30+00:00 2026-05-26T12:09:30+00:00

I’m working on a jQueryMobile application with some form fields that need auto complete

  • 0

I’m working on a jQueryMobile application with some form fields that need auto complete functionality. I’m working with jQueryUi Autocomplete plugin but can’t get it to work properly. It works fine if my form is the initial page loaded in the browser but doesn’t work if the form is loaded later via the jQueryMobile ajax loading mechanism.

The versions I’m working with are:
jQueryMobile: 1.0a4.1
jQueryUi: 1.8.9
jQuery: 1.4.4

My auto complete function looks like this:

$(function () {
    $('#search').autocomplete({
        source: '/Autocomplete/SearchAutoComplete',
        minLength: 3,
        select: function (event, ui) { }
    });
});

My thinking is that this needs to be wired up to the current active page but I’m not sure how to do this. Can someone let me know how to accomplish this?

Also, I’m not tied to the jQueryUi autocomplete solution. If there is a better way to do this, please let me know.

Thanks,
Greg

  • 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-26T12:09:31+00:00Added an answer on May 26, 2026 at 12:09 pm

    Now that JQuery Mobile has matured quite a bit and is getting close to it’s 1.0 release, I decided to take another stab at getting this to work properly. I’ve had good success so I’d like to share the solution here.

    Here are the versions I am now currently working with (as of 01-Feb-2012):

    jQuery Mobile 1.0.1
    jQuery 1.6.4
    jQuery UI 1.8.12

    The order in which the scripts are referenced is critical. It needs to be jQuery, jQuery UI, jQuery Mobile, then your custom script file last. My page head looks like this:

    <head>
       <meta charset="utf-8" />
       <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
       <title>My jQM App</title>
       <link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
       <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>
       <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.12/jquery-ui.min.js" type="text/javascript"></script>
       <script src="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.0.1/jquery.mobile-1.0.1.min.js" type="text/javascript"></script>
       <script src="/Scripts/script.js" type="text/javascript"></script>
       <link rel="stylesheet" href="/Content/style.css" />
    </head> 
    

    All of the autocomplete code should be in a separate .js file and should be the last file linked to. In this sample, mine is script.js.

    Next, make sure that all of your page div’s (data-role=’page’) also have an id set. For example, on my search page I have

    <div data-role="page" id="searchPage">
    

    Now that all the page div have id’s you can bind to the jQuery Mobile pagecreate event for that div. In a standard jQuery page you would have something like this for the autocomplete:

    $('#search').autocomplete({
        source: '/Autocomplete/SearchAutoComplete',
        minLength: 3,
        select: function (event, ui) { }
    });
    

    To do the equivalent but have it hooked up to the specific page div looks like this:

    $('#searchPage').live('pageinit', function (event) {
        $('#search').autocomplete({
            source: '/Autocomplete/SearchAutoComplete',
            minLength: 3,
            select: function (event, ui) { }
        });
    });
    

    This has been working well for me so far. I’ve been able to strip out most of data-ajax=”false” attributes I had in place as a workaround. This, in turn, has resulted in better application performance. I have by no means done an exhaustive compatibility test between jQuery UI and jQuery Mobile so your mileage may vary. Please leave a comment here if you run into any problems with this method. Good luck.

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

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have some data like this: 1 2 3 4 5 9 2 6
I need to clean up various Word 'smart' characters in user input, including but

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.