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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:22:06+00:00 2026-06-05T10:22:06+00:00

I was trying this Demo by jQuery UI on my own project and found

  • 0

I was trying this Demo by jQuery UI on my own project and found one essential modification in need for it. See on below Demo :

http://jqueryui.com/demos/autocomplete/#custom-data

In this example, When we type “j” and select any one option, it fetch some text and logo related to it. Which is working fine. Here, lets say we select “jQuery” from the auto-suggestions given. It will load text and jQuery logo on the left side. But suppose after doing this, if we delete some characters of the word “jQuery” from textbox then it should reset and display blank outputs. But it remains same text and logo which loaded previously.

In general, what I want to do is, user must select something from autosuggestion and not write anything that is not in the auto suggestions give.

How can we do that?

Thanks in advance.

  • 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-05T10:22:08+00:00Added an answer on June 5, 2026 at 10:22 am

    you can override the select and change event to achieve this:

     $(".combobox").autocomplete({
        minLength: 0,
        source: function (request, respond) {
            //some source
        },
        change: function (event, ui) {
            //if no value inside the LI, reset the input -> uses a custom selector
            if ($(".ui-autocomplete li:textEquals('" + $(this).val() + "')").size() == 0) {
                $(this).val('');
        },
        select: function (event, ui) {
            $(this).val(ui.item.Name);
        }
     );
    

    You just need a custom selector to compare the text-input:

    $.expr[':'].textEquals = function (a, i, m) {
        return $(a).text().match("^" + m[3] + "$");
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to use this page slider jquery plugin, you can see the demo
I'm trying to use the rounded corners demo for jQuery (http://plugins.jquery.com/project/corners), but I'm getting
I am using this jQuery plugin: http://demo.awkwardgroup.com/showcase/ I am trying to show a counter
I'm trying to upload files via this jQuery plugin: http://aquantum-demo.appspot.com/file-upload I am able to
using this https://github.com/jonthornton/jquery-timepicker demo here: http://jonthornton.github.com/jquery-timepicker/ on a rails 3.2 app trying to use
I am trying to implement this demo on my local machine. http://bit.ly/4g4o1r I have
I'm trying to create this effect: http://www.thecssninja.com/demo/css_tree/ the problem I'm having is that the
Live demo: http://jsfiddle.net/stapiagutierrez/KKdsb/29/ I'm just trying to create my own star rating UI for
I'me trying to use this eventCalendar in django : http://jquery-week-calendar.googlecode.com/svn/trunk/jquery.weekcalendar/full_demo/weekcalendar_full_demo.html I suppose to write
I'm trying to use the following plugin for date picking: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html And I'm trying

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.