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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:30:09+00:00 2026-06-14T16:30:09+00:00

I am using jQuery UI v1.9. I successfully implemented the jQuery UI Autocomplete widget

  • 0

I am using jQuery UI v1.9. I successfully implemented the jQuery UI Autocomplete widget but I have some trouble when I have to handle cases when a user doesn’t select any item from the open menu but still continue to type letters in the related autocomplete field (that is, cases when the user continues to type letters even if the autocomplete menu is hidden because no item with the name as the entered one is present in that menu).

In such cases (when no item selection was performed but a string is present in the autocomplete field), I would like to alert the user that he / she is no selecting an existing object but that he / she is typing a custom one. How can I make that?


Note: Practically speaking, I am trying to force the user to select an existing item or, if that was not selected, to prompt he / she to create a new one.

  • 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-14T16:30:11+00:00Added an answer on June 14, 2026 at 4:30 pm

    You can set a callback function for the change event of autocomplete plugin where you should be able to check if an item has been selected:

    $( "#autocomplete" ).autocomplete({
         change: function(e,ui){
             if(ui.item === null)
               alert('No item has been selected')  
        }
    });
    

    UPDATE:

    If you want to trigger change event before input loses focus, you could use following code, triggering it on keypress event:

    $( "#autocomplete" ).autocomplete({
             change: function(e,ui){
                 if(!ui || ui.item === null)
                     console.log('No item has been selected') 
            }
        }).on('keypress',function(){$(this).autocomplete('option','change').call()});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery Templates successfully but I have a blur function that is
I am using a counter plugin for jquery (http://wplayground.comuv.com/counter/) and have it implemented successfully
On my new customer page , I have successfully implemented a jQuery show/hide toggle
I have successfully implemented JQuery Sortable. I can also write it to the database
I have been using jquery validate plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ . It has been working successfully,
I've successfully implemented a filter using the jQuery isotope plugin which filters out the
I've pretty much successfully implemented an instance of jQuery's scrollable plugin but I'm having
I am using JQuery tabs in my page, and have successfully managed to place
Good day, using JSP and jQuery UI I have successfuly implemented autocompletion for a
I have successfully implemented the Valums script for uploading multiple files asynchronously. But I

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.