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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:25:54+00:00 2026-06-14T17:25:54+00:00

I’m trying to modify this example on making a live updating list to integrate

  • 0

I’m trying to modify this example on making a live updating list to integrate it with my API. So, instead of using GET on the page with the form, I’d like to send it to that page via a function call.

Ok, So the problem is that it’s not returning anything. I’m not sure if gethint.php is actually receiving a value. If you look at gethint.php on the link I provided, it sets

$q = $_GET['q']. 

When I echo that nothing shows, so I don’t think it’s sending the value, despite the alert message showing what’s in the box (on message.php)

So, here’s my form

// message.php

//function to display the hint sent from gethint.php
function message_hint($hint){
    echo $hint;
}

//displays the form for sending messages
function send_message_form($to_user,$title,$message){
    include 'gethint.php';
    ?>
    <table>
    <form name = "send_message" method="post">
    <td>Send A Message</td>
    <tr><td>To:</td><td><input type = "text" size="50" name="to_user" id = "to_user" value ="<? echo $to_user; ?>" onkeyup="showHint(this.value)"></td></tr>
    <tr><td>Title:</td><td><input type = "text" size="50" name="message_title"></td></tr>
    <tr><td>Message:</td><td><textarea rows="4" cols="50" name="message_details"></textarea></td></tr>
    <tr><td><input type="submit" name="submit_message"></td></tr>
    </table>
    </form>
    <?
}

Here’s the head of message.php

<head>
<script>
function showHint(str){
var to_user = document.getElementById("to_user").value //to_user is the id of the textbox
if (str.length==0){  
    to_user.innerHTML="";
    return;
}
if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
}else{// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
    if (xmlhttp.readyState==4 && xmlhttp.status==200){
            alert(to_user) //properly displays the name via alert box
        to_user.innerHTML=xmlhttp.responseText;
    }
}
xmlhttp.open("GET","gethint.php?q="+to_user,true);
xmlhttp.send();
}
</script>
</head>

The page gethint.php is exactly the same, aside from this at the bottom.

//echo $response //this was the original output
$message = new messages;
$message->message_hint($response);
  • 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-14T17:25:55+00:00Added an answer on June 14, 2026 at 5:25 pm

    In the first place, I recommend using jQuery for AJAX calls. See these examples.

    Next, I suggest using jQueryUI for your autocomplete functionality. See the example on this page.

    Your code will be reduced by > 50% and you may find it much easier to understand.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.