No. All of the examples I find are like the 'google' style suggest-thingy. I want to dynamically (AJAX) populate an actual: <select> <option value='1'> foo <option value='2'> bar <option value='3'> fee <option value='4'> fum </select> Basically the core problem is passing back an 'array' of data from mysql into JS to make the box. What I've 'hacked' together so far is that I return my values like so from PHP/mySQL to JS AJAX: $tmp = "1|foo|2|bar|3|fee|4|fum"; And then in JS, I do this: tokens = tmp.split('|'); Then use a for(i++2) loop and build up the options (key and value) of the select box. But, to me this seems like a hack. Plus I'm a little worried that there is going to be a size limit of characters or data or something? After all, AFAIK AJAX uses $_GET method right? Not $_POST. So I think GET has a limit of like 1024 characters, whereas POST doesn't have that limit. My select box could have potentially thousands of items in it. Say for example, IP addresses. I have supporting select boxes to filter by ranges, or groups, or whatever, but there's nothing restricting a user from NOT using them, and just wanting to see ALL the IP addresses... So, I guess what I'm asking, is, is this the right way to solve this challenge, or is there a better/more accepted way? > -----Original Message----- > From: tedd [mailto:tedd@xxxxxxxxxxxx] > Sent: Saturday, March 18, 2006 1:02 PM > To: php-general@xxxxxxxxxxxxx; Daevid Vincent > Subject: Re: PHP, SQL, AJAX, JS and populating a SelectBox? > > >I need to dynamically update a select box > >with results from a SQL database using AJAX, > >but I can't find a single example of how to do this. > > > >Basically I have a text input field, and a select box. > >As someone types in the input field, > >I want the select box to fill in the results of matches. > > > >I can fill in a <DIV> (as per the ten million examples out there) > >and that's all fine and dandy, but way too simplistic for > what I need. > > Select Box? > > Do you mean a Selection List, that will change as the user types in > an input field like this: > > http://www.itsyourdomain.com/ > > Just type domain name into the search box -- is that what > you're looking for? > > tedd > -- > -------------------------------------------------------------- > ------------------ > http://sperling.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php