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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:01:33+00:00 2026-05-23T07:01:33+00:00

Two things I’m trying to adjust in my usage of JQuery autocomplete in PHP.

  • 0

Two things I’m trying to adjust in my usage of JQuery autocomplete in PHP.
1. I would like that when I chose an option it will auto-submit the form (currently it requires two enters)
2. When I continue to write and no new options exist is still shows me the old options. I would rather it not suggest un-relevant options even if none exist.

Thanks

UPDATE:
I’ve resolved num. 2, for future readers the problem was I sent null instead of an empty json from the source url.
Regarding num. 1, I’ve done as suggested and now my JQuery js code looks like this:

$( "#searchid" ).autocomplete({
    source: "/autocomplete_url.php?more=1",         
});

$("#searchid").result(function (event, data, formatted) 
{
    alert("o"); // just to check if got here
    $('#formid').submit();
});

However, The result function is never invoked (I’ve added a simple alert to verify that). Any idea why?

  • 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-23T07:01:33+00:00Added an answer on May 23, 2026 at 7:01 am

    For 1.) you can simply submit the form through jquery from within the result(handler). Look at this – http://docs.jquery.com/Plugins/autocomplete if you look at the last code sample on the page, instead of redirecting, you can simply submit the form instead within the result call.

    Regarding the 2.) point, well jquery autocompletes works just like that, perhaps you’re doing something wrong or expecting something wrong, please give more information regarding the same.

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

Sidebar

Related Questions

I would like to make a file browser that will do two things: 1)
I would like to accomplish two things during my build process: Run unit tests
I would like to do two things within my Android app : Check if
I am trying to create a rewrite rule that accomplishes two things: Redirect (www.)?domain.com
I would like to determine two things from a single query: Most prevalent column
I'm trying to do two things: Show a hidden field if an option is
I would like to have two things happen at once when I click on
I would like to know two things about the following code: HttpWebRequest objRequest =
I want to create a trigger in MySQL that will do two things: if
I'm writing a (very) simple Visual Studio addin. Two things that would make it

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.