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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:21:40+00:00 2026-06-01T20:21:40+00:00

I am trying to develop a feature on my website that automatically grabs routes

  • 0

I am trying to develop a feature on my website that automatically grabs routes available from my table and populate them in a jQuery autocomplete textbox that shows results as they type

I’ve managed to get the query together, and it works perfectly…but without the jQuery added onto it

Heres the code on its own

<?PHP  
mysql_connect('localhost', 'sample', 'sample'); 
mysql_select_db('winning'); 
$sql = "SELECT distinct rout_to FROM search_v ORDER BY rout_to ASC" ; 
$result = mysql_query($sql); 
echo '<div class="ui-widget"><select id="combobox" name="arrival_label">'; 
while ($row = mysql_fetch_array($result)) echo "<option value='" . $row['rout_to'] . "'>" . $row['rout_to'] . "</option>"; 

echo "</select></div>"; ?>

when i tested the autocomplete combobox from the jquery ui library, it worked fine on its own, without the php data

My question was, how would I get these two to play nice?

  • 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-01T20:21:41+00:00Added an answer on June 1, 2026 at 8:21 pm

    YOu might wanna try using Jquery UI’s auto complete plugin.

    <?php
        $autocomplete = array();
        mysql_connect('localhost', 'sample', 'sample'); 
        mysql_select_db('winning');
        $sql = mysql_query('SELECT distinct rout_to FROM search_v ORDER BY rout_to ASC');
        $r = $db->query($q);
        while ($row = mysql_fetch_array($result))
          $autocomplete[] = $row['rout_to'];
        }
    ?>
    <script>
        $(function() {
            var availableTags = [
              <?php foreach($autocomplete as $a){
                  echo '"'.$a.'",';
              }?>
            ];
            $( "#tags" ).autocomplete({
                source: availableTags
            });
        });
    </script>
    

    HTML CODE:

    <div class="ui-widget">
        <label for="tags">Tags: </label>
        <input id="tags">
    </div>
    

    I think in this case you will no longer be using a select tag but an input tag. I hope it helps.

    Thanks,Dave

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

Sidebar

Related Questions

I am trying develop a basic referrer system to my Django website, system will
im trying to develop an app for a win CE mobile device that downloads
I'm trying to develop a class that supports an asynchronus method invocation. This is
I am trying to develop a feature into my app to backup sms and
trying to develop web form using jquery. all i need is to have several
We are trying to develop a timeout feature in application where we want alert
I'm trying to develop an app for ipad and I'm using the contenteditable feature.
railsnoobquestion: I am trying to develop a feature where a user can save an
I am trying to develop a tool that inserts comments in C/C++ source files
I'm trying to learn iOS development . To do that, I wanted to develop

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.