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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:36:02+00:00 2026-06-16T22:36:02+00:00

I am creating a social website.I have a text box in search.php to search

  • 0

I am creating a social website.I have a text box in search.php to search the venues which are stored in database.When user starts typing the name of the venue,list of venue names stored in database should be loaded into the div venuesearch. This works fine.My problem is that I need to make the row inside the div venuesearch clickable, so that when the user clicks a particular row,that value should come to the text box.

search.php

<script language="javascript">
function showData(str)
{
    if (str.length==0)
    {
        document.getElementById("venuesearch").innerHTML="";
        document.getElementById("venuesearch").style.border="0px";
        return;
    }
    var venue_data = document.getElementById("venue").value;
    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)
        {
            document.getElementById("venuesearch").innerHTML=xmlhttp.responseText;
            document.getElementById("venuesearch").style.border="1px solid #A5ACB2";    
            document.getElementById("venuesearch").style.zIndex = "100";
        }
    }
    xmlhttp.open("GET","aj_search.php?venue="+str,true);
    xmlhttp.send();
}
 </script>
 </head>

<body>

<input id="venue" name="venue" type="text" onkeyup="showData(this.value)" value="Tag venue name"/>
<div id="venuesearch">
</div>
</body>

aj_search.php

  <?php
$dbhandle=mysql_connect("localhost","root","")or die("Unable to connect");
$select=mysql_select_db("scenekey",$dbhandle) or die("Unable to connect");

    if(isset($_GET['venue']))
    {
  $venue_name = $_GET['venue'];
    }
    $hint='';
    $query_get_venue = "SELECT * from sk_accounts WHERE acnt_member_class='venue' and acnt_fname LIKE '".$venue_name."%'";

     $result_query_get_venue = mysql_query($query_get_venue);
     $row_count = mysql_num_rows($result_query_get_venue);
 if($row_count > 0)
 {
    $hint = "<table>";
     while($row = mysql_fetch_array($result_query_get_venue))
     {

         $act_fname = $row['acnt_fname'];
         $act_lname = $row['acnt_lname'];
         $act_name = $act_fname . ' ' . $act_lname;
         $hint.= "<tr><td>".$act_name."</td></tr>";
     }
     $hint .= "</table>";
 }
     if ($hint == "")
     {
   $response="no suggestion";
     }
     else
     {
 $response=$hint;
      }

     //output the response
     echo $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-16T22:36:03+00:00Added an answer on June 16, 2026 at 10:36 pm

    Add id or class and then set click event for the same or add javascript function

     $hint.= "<tr onClick ='hintVal(".$act_name.");'><td>".$act_name."</td></tr>";
    

    In javascript:

    function hintVal(trVal) {
     alert('tr clicked');
     alert('tr value:'+trVal);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a Facebook-like social-network website. For my wall, I have many different kind
I am creating a small social network in which when a user posts anything.I
I'm creating a social network in Rails. I have a User model and a
I'm creating a social network. I want to have a user be able to
I'm currently creating a website for a social project in switzerland. And before there
Creating a JApplet I have 2 Text Fields, a button and a Text Area.
I'm currently developing a large site that handles user registrations. A social networking website
I am creating a social tool - I want to allow search engines to
I have a problem as, I am creating an app as a social networking
I'm creating a social network and I have a pretty specific case, and I've

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.