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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:47:35+00:00 2026-06-18T21:47:35+00:00

how can i use a single jquery autocomplete for multiple form dropdown? here is

  • 0

how can i use a single jquery autocomplete for multiple form dropdown?

here is my view page(header):

$("#full_name").autocomplete({
   source: "<?php echo site_url('autocomplete/get_names');?>"
});  

$("#department").autocomplete({
   source: "<?php echo site_url('autocomplete/get_dept');?>"
});  

*** and other like these for subjects, zip and country. 

controller page:

public function get_names(){
 $this->load->model('autocomplete_model');
    if (isset($_GET['term'])){
    $q = strtolower($_GET['term']);
    $this->autocomplete_model->get_fullnames($q);
 }
}  
*** and other functions... 

model page:

function get_fullnames($q)
{
$match = $q;
$this->db->select('full_name');
$this->db->like('full_name', $match,'after');
$query = $this->db->get('employee_list');

    if($query->num_rows > 0){
      foreach ($query->result_array() as $row){
        $row_set[] = htmlentities(stripslashes($row['full_name'])); 
        }
        echo json_encode($row_set); 
    }

}

how can i implement a single search term that could be used for multiple criteria?
thank you guys 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-18T21:47:37+00:00Added an answer on June 18, 2026 at 9:47 pm

    This is not going to scale; as your database tables grow, this implementation will become very sluggish. What you need to do is use an indexing engine to allow Full Text Searching.

    MySQL does not allow Full Text Search on InnoDB tables (actually, it was just released in the latest version, but it’s still in it’s infancy). Look into using Elastic Search, Sphinx, or Solr.

    Poke around StackOverflow to find the best engine for you – there are many helpful questions that have been asked in the past regarding this problem. Hopefully that sets you on the right course.

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

Sidebar

Related Questions

How can I use FancyBox or JQuery to create multiple pop-up DIVs that all
I was wondering if i can use a single query in sql server 2005
How can use regex to make sure that is only a single slash end
I'm trying to find a single regular expression that I can use to parse
I have a master-detail page, in which I use GridView to display multiple rows
I am trying to use a single plugin of jquery and I want to
jQuery uses $ (dollarsign), is there a standard sign one can use for my
This is a very simple use of jQuery that I can't get working. When
I have been reading here and there about multiple JQuery selectors but I couldn't
I have a form which is essentially an autocomplete input box. I can get

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.