Jump to content

Recommended Posts

im learning how to do a live search, and the way i do that is by getting a working script to break down and play with

 

i found one at w3schools. but the codes dont work... can someone find out why?

http://www.w3schools.com/php/php_ajax_livesearch.asp

 

the example on their site works, but when i try it it just shows a text field, and a border...?

Link to comment
https://forums.phpfreaks.com/topic/64360-live-search-example-with-ajax/
Share on other sites

Its sorta tricky because the live search actually returns the results into the text box (I think) what you need to do is apply a div that will receive the return of the ajax function and then insert that string into the box.  It will take some playing with in JS to format it to nice results, but it isn't too difficult.

well i was thinking that

 

but on the example they have, it actually shows up as a div box underneath of the textbox

 

what i dont get, is if i copy the code they gave me, (even the link rel stylesheet they use) and i dont get what they do,... what could i have done wrong

this is the defintion  (not js expert either...)

 

function GetXmlHttpObject()

{

var xmlHttp=null;

try

{

// Firefox, Opera 8.0+, Safari

xmlHttp=new XMLHttpRequest();

}

catch (e)

{

// Internet Explorer

try

  {

  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

  }

catch (e)

  {

  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

}

return xmlHttp;

}

 

 

i mean this is exactly what w3schools.com gave me, i have changed nothing yet

not having luck... i think i just need to walk away for tonight.

 

i created the table using their sql commands, that worked fine.

i edited the database.php with my server info that i use for the same database on other sites so i know it works.

 

and i get loaded their files onto my server, and nothing

 

i think its just a bad luck night

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.