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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:11:05+00:00 2026-05-31T09:11:05+00:00

I am trying to implement a functionality where a user can select a list

  • 0

I am trying to implement a functionality where a user can select a list of items from the dropdown suggestions and save new items using a dialog box if and only if there are no suggestions. I am currently implementing it as follows,

suggestOpened = false;//Initially set flag to false
....
open: function(evt, ui) {
  suggestOpen = true; //Set the flag to true when the list is opened
}
change: function(event, ui) {
  if(!suggestOpened) {
    //open dialog box
  }
  suggestOpened = false; //List will be closed here so reset flag
}

The problem with this is that if the user returns to the field in the same session and wants to save another item, the flag will be set to false so the dialog will not be opened. Can I somehow have access to the response from the ajax request and find out if the response contained suggestions from the source?

Thanks,
Roland

  • 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-31T09:11:06+00:00Added an answer on May 31, 2026 at 9:11 am

    You’re pretty close– the change event can actually handle this:

    $("#auto").autocomplete({
        source: ['hi', 'bye', 'foo', 'bar'],
        change: function (event, ui) {
            var newItem = !ui.item;
    
            if (newItem) {
                /* open your dialog */
                $("#dialog").dialog("open");
            }
        }
    });
    

    Example: http://jsfiddle.net/8RmRY/

    The only caveat here is that if the user types something that exists in the list but does not physically select an item, newItem will be true. If that’s a problem, I can expand my answer.

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

Sidebar

Related Questions

trying to implement a dialog-box style behaviour using a separate div section with all
So Im trying to implement a file upload functionality where when a user uploads
I am trying to implement the following functionality in my application The user selects
I'm trying to implement PDF functionality to my application. So, I added some new
I'm trying to implement the export functionality for my database application. I'm using C#
I'm trying to implement a piece of functionality that will let the user to
I'm trying to implement drag and drop functionality in a Surface Application that is
Am trying to implement a generic way for reading sections from a config file.
I am trying to implement Facebook Connect functionality into a website that I am
I am trying to implement a type of slider using jquery. However this question

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.