PDA

View Full Version : Auto-Suggest Text in Forms



NGJ
02-07-2008, 09:46 AM
There are "many" examples of auto-suggest / auto-complete scripts out there .....

i.e. User types "Jo"
& the drop down box suggests:

Joanne
Jon
Jones, etc., etc.,

These are all based on recognising the first characters in the string.
What I'm looking for is to be able to achieve the same if the user were to type "on", for example, to result in:

Jon
Jones, etc.

Is this feasible in JS alone, without the use of a database? :confused:

Thanks in advance,

N.

codeexploiter
02-07-2008, 10:46 AM
Yes it can be done either via a database or via JS/AJAX.

YUI AutoComplete Control (http://developer.yahoo.com/yui/autocomplete/)

You can find the demo pages that performs the auto completion in various different modes.

NGJ
02-07-2008, 01:46 PM
Thanks for your reply. It looks like this provides an option to achieve this.

Appreciate your help!

BYK
02-07-2008, 07:28 PM
It can also be made by regular expressions of Javascript I think.

NGJ
02-08-2008, 02:22 PM
Are you able to provide any examples or point to a link at all please?