suess0r Posted December 6, 2006 Share Posted December 6, 2006 OK, here's what i'm looking for...I want to be able to search through my DB for club_name = to the textbox being inputed. I can search and retrieve the data i'm looking for fine in the textbox, after they hit submit... but i'm trying to have a listbox appear under the textbox that autofills these results AS THEY ARE TYPING after the 3rd character. I'm not sure how to parse the field name by individual characters, nor how it refreshes after each letter and refreshes the results to match. Would I be wanting to look into javascript for this or what would you suggest?just like www.kayak.com does on their search.Thanks! ;D Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/ Share on other sites More sharing options...
papaface Posted December 6, 2006 Share Posted December 6, 2006 This would not be something PHP could do, as PHP is server-side not client-side. You would probably have to look into something like javascript for this. Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/#findComment-135834 Share on other sites More sharing options...
fert Posted December 6, 2006 Share Posted December 6, 2006 you could use AJAX Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/#findComment-135836 Share on other sites More sharing options...
suess0r Posted December 6, 2006 Author Share Posted December 6, 2006 ya that's what i figured, i'll look around.. thanks for the input Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/#findComment-135839 Share on other sites More sharing options...
artacus Posted December 6, 2006 Share Posted December 6, 2006 We have an Ajax forum so a mod might move this, but this is what you do.You need an onkeypress handler on your input field. Check that the text length is > 2 and then fire off an ajax request that populates a list in an empty div right below your text field.Each list item will have an onclick event handler that inserts its value into the text field then clears the div. Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/#findComment-135844 Share on other sites More sharing options...
willfitch Posted December 6, 2006 Share Posted December 6, 2006 You need to take a look at my article in this month's php|Architect magazine. It could really help you out.http://www.phparch.com/issue.php?mid=93 Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/#findComment-135869 Share on other sites More sharing options...
mainewoods Posted December 6, 2006 Share Posted December 6, 2006 the w3schools ajax tutorial covers exactly how to implement the 'google suggestion' like feature you want:http://www.w3schools.com/ajax/default.asp Link to comment https://forums.phpfreaks.com/topic/29603-auto-fill-listbox-after-3-characters-entered/#findComment-135879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.