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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:16:15+00:00 2026-05-30T15:16:15+00:00

I am working on auto complete and used this http://jqueryui.com/demos/autocomplete/#combobox Now my query is

  • 0

I am working on auto complete and used this http://jqueryui.com/demos/autocomplete/#combobox

Now my query is that this api gives the user a flexibility to type and search the values of combo-box but due to this user can type anything.But is there any way to restrict the user from submitting wrong search query. This is because my combo-box is going to be used as a search criteria and its value is submitted to next page and due to this feature it submits wrong data to the page.

Thank you in advance…
thanks

  • 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-30T15:16:16+00:00Added an answer on May 30, 2026 at 3:16 pm

    You could try a custom matcher function to force a match or clear the field…

    $("#input").autocomplete({ << initialise the autocomplete here >>})
    .on('blur', function(event){
      // Grab the autocomplete object
      var autocomplete = $(this).data("autocomplete");
      var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i");
      // Iterate through the autocomplete list items to find any partial or full matches
      autocomplete.widget().children(".ui-menu-item").each(function() {
        var item = $(this).data("item.autocomplete");
        if (matcher.test(item.value || item)) {
          //There was a match
          matchcount++;
          autocomplete.selectedItem = item;
          return;
        }
      });
      if (autocomplete.selectedItem) {
        //if there was a match trigger the select event on that match
        autocomplete._trigger("select", event, {
          item: autocomplete.selectedItem
        });
      //there was no match, clear the input
      } else {
          $(this).val('');
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm now using http://jqueryui.com/demos/autocomplete/ based on some previous recommendations and it's working well for
I am using the jQuery autocomplete (http://jqueryui.com/demos/autocomplete/) and have it working but when a
I have auto complete for a JCombobox working by following this article: http://today.java.net/pub/a/today/2007/07/19/adding-auto-completion-to-swing-comboboxes.html I
i am using the jquery auto complete script like this $(#ac1).autocomplete('search.php'); And it is
I have installed Eclipse Indigo and the auto-complete feature is working normally in the
I've got my autocomplete plugin working perfectly... except I have certain info that I
Currently, I have this version of the autocomplete control working when returning XML from
I'm working on a project where I need a jQuery auto-complete for Cities. What
There's something in my preferences file that is causing Eclipse's auto-complete feature (for Java)
I am using older JQuery Autocomplete plug-in (the one shown here - http://view.jquery.com/trunk/plugins/autocomplete/demo/ ).

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.