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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:24:46+00:00 2026-05-22T21:24:46+00:00

I need some help on a autocomplet function using ajax My problem is :

  • 0

I need some help on a autocomplet function using ajax
My problem is : the browser is caching the suggestions from ajax when i press enter on a suggestion, so the next time I’m typing in the suggestion field, i get de value from the cach

Here is the part of the Ajax code through which I send a value to the php code and get the respondsetext

xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“txtHint”).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open(“GET”,”suggest.php?q=”+str,true);
xmlhttp.send();

and the input tag

input id=”valx” onKeyUp=”autocomplet(this.value)”

Example: I type in the input field “Htm” and I get the suggestions “Html”,”HTML CSS” , “HTML XMLS” …. so if I chose “HTML CSS” and press enter, the next time I type “Htm” in the input field the browser shows the cached value => “HTML CSS” an of course I also have my suggestions send by ajax Html”,”HTML CSS” , “HTML XMLS” ….. I want to get rid of the cached values send by the browser

I saw a tutorial for my problem but I dont know how to apply it to my code because I”m already sending a request through “q”.
The cod from the tutorial looks like this

xmlhttp.open(“GET”,”demo_get.php?t=” + Math.random(),true);
xmlhttp.send();
it is using the random method to send different data request each time ??

Any help would be much appreciated! 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-22T21:24:47+00:00Added an answer on May 22, 2026 at 9:24 pm

    If the browser is interfering with your AJAX-y autocomplete, try setting autocomplete="off" on the input element.

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

Sidebar

Related Questions

Need some help with this problem in implementing with XSLT, I had already implemented
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I need some help from the shell-script gurus out there. I have a .txt
I need some help regarding algorithm for randomness. So Problem is. There are 50
Need some help with a small problem. I'm not too hot on the maths
Need some help in creating function which can create folders recursively with giving path:
I need some help from some linux gurus. I am working on a webapp
Need some help designing a bash script for grepping IP addresses from auth.log and
I need some help with a formatting function. I need to be able to
Ok need some help here. I have an autocomplete setup to pull from a

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.