How to show a drop down of tagged strings in a input field?

Alles, was PHP betrifft, kann hier besprochen werden.

How to show a drop down of tagged strings in a input field?

Postby sprinkel » 02. December 2010 12:26

Dear all,

I want to use an input field in a site. Not spectacular so far.
But to help a user with data entry, I want to show a drop down of strings as suggested values, based on the characters that are already typed in the input field.
The characters in the input field are used to tag strings, coming from a mysql query and placed in an array.
These strings are a kind of reference and when a sequence of typed characters in the input field matches with a sequence of characters in the reference strings, this string is shown in a drop down an can be copied to the input field by selecting it. When there isn't a match, the user can enter a unique string in the input field.

You see this kind of features quite a lot but I don't know how to solve this.
Does anybody haves an idea how to solve one and other?

Regards,
Cees
sprinkel
 
Posts: 16
Joined: 29. August 2009 01:38
Location: Netherlands
Operating System: Windows Vista

Re: How to show a drop down of tagged strings in a input fie

Postby Nobbie » 02. December 2010 14:31

Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: How to show a drop down of tagged strings in a input fie

Postby sprinkel » 02. December 2010 15:57

Sorry Nobey,

This is not what I mean. A simple option box isn't hard to create, but the possibility to type characters and find matches with reference strings is the challenge.
sprinkel
 
Posts: 16
Joined: 29. August 2009 01:38
Location: Netherlands
Operating System: Windows Vista

Re: How to show a drop down of tagged strings in a input fie

Postby Altrea » 02. December 2010 18:07

What you want to do is a "Autocompleter".
I recommend you to use a JavaScrict Framework for this because handeling AJAX Requests is not that easy if you had to script this for different users.
JQuery UI Autocomplete seems something that could help you.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to PHP

Who is online

Users browsing this forum: No registered users and 14 guests