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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:11:36+00:00 2026-06-13T08:11:36+00:00

I attended a video that describes how to implement a autocomplete in input. in

  • 0

I attended a video that describes how to implement a autocomplete in input. in the end I tested in firefox and chrome and it works well, except in internet explorer: here is the code below :

jquery :

function getSuggestions(value){
        if(value!=''){  
                $.get('suggest.php', {requestKword:value}, function (data){
                            $('#suggestions').show();
                            $('#suggestions').html(data);
                            doCSS();
                    });
        }
        else{
            removeSuggestions();
        }
}
function removeSuggestions(){
    $("#suggestions").html("");
    undoCSS();
}   
function fill(thisValue) {
    $('#ii').val(thisValue);
    setTimeout("$('#suggestions').hide();", 200);
}
function doCSS(){
$("#suggestions").css({
    'border' : 'solid',
    'border-width':'1px',
    'position': 'relative'
    });
}
function undoCSS(){
$("#suggestions").css({
    'border' : '',
    'border-width':''
    });
}
function addText(value){
        $("#ii").val(value);
}

css :

#suggestions{
text-align:left;
padding-left:5px;
font-size:14px;
}
#link:hover{ background-color:#f0f0f0; cursor:default;}

html :

<form action="/" method="get" id="set" name="set">
<input id="ii" type="text" name="q" size="96px"  value=""  onblur="fill();"  onkeyup="getSuggestions(this.value)"  /><br />
<div id="suggestions"></div>
</form>

mysql :
suggest.php

mysql_connect('localhost', 'root', '');
mysql_select_db('keywords') or die (mysql_error());
$keyword=mysql_real_escape_string($_GET['requestKword']);
$result = mysql_query("SELECT * FROM `table`.`keys` where `column` like '$keyword%' LIMIT 0 , 10") or die (mysql_error());
while($row = mysql_fetch_assoc($result)){
    echo '<div id="link" onclick="addText(\''.$row['keyword'].'\')" ">'.$row['keyword'].'</div>';
}
  • 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-13T08:11:38+00:00Added an answer on June 13, 2026 at 8:11 am

    You may want to consider jQuery autocomplete plugin here: http://jqueryui.com/autocomplete/. It has nice working demo; tips ….

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

Sidebar

Related Questions

I have a database that logs when an employee has attended a course and
I have recently attended a presentation where guy showed that .NET obfuscated code can
A coding style presentation that I attended lately in office advocated that variables should
I attended a session in which it was taught that we should not use
I recently attended an interview where I was asked to implement a linked list
So a user has many colleges (that they have attended), and a college belongs
Recently I attended a lecture concerning some design patterns: The following code had been
I've recently been studying TDD, attended a conference and have dabbled in few tests
Attended a 2 week Java EE course and learnt the concepts. Want to try
I attended a payroll software demo yesterday wherein the year dropdowns throughout the software

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.