A Google link?  Come on, man.  Why even reply?

Phunky, there are autocomplete plugins.  You can find them on this page:
http://docs.jquery.com/Plugins

I've used and enhanced this one:
http://www.pengoworks.com/workshop/jquery/autocomplete.htm

My enhanced version includes the changes listed below.  Let me know if you'd
like to use it!

Updates to jquery.autocomplete.js

- You can have a question mark in your Url (will use a & instead, in that
case).
- Responses are expected to be Json.
- If there are more results than the number to be displayed, an ellipsis is
shown.
- Added the option displayField.  Whatever you specify for this option will
be the field that is displayed in the search results.  The default is "id".
- Added the option valueField.  Specify a string to use as the attribute to
use for the value of the field.  The default is "id".
- Added the option formFieldForValue.  Specify a string that matches the
field you want to use to store the value of the selected item.  For example,
"#MyHiddenField".
- Took out the caching for now, because it was causing problems and I don't
currently think it's a good idea.
- Added the option onUnknownValueEntered, which is an event called when the
user enters a value that isn't found.  The value entered is passed as a
parameter to the function you specify.
- The onItemSelect and onUnknownValueEntered callbacks pass the input field
to you as the second argument (the first being the li).

Bugfixes:
- Fixed a bug in moveSelect(step) that allowed an empty list (lis) to be
indexed into, even when the .length was 0.
- Fixed a bug which caused raw Html to be inserted into the autocompleted
field when tabbing when nothing was selected.
- In selectItem(li), I added a line that converts all of the Html entities
(e.g. &) to their textual counterparts (e.g. &).


Diego A. wrote:
> 
> 
> Start here:
> http://www.google.co.uk/search?q=jquery+autocomplete&sourceid=navclient-ff&ie=UTF-8&rls=GGGL,GGGL:2006-14,GGGL:en
> 
> 
> On Aug 30, 9:33 am, Phunky <[EMAIL PROTECTED]> wrote:
>> Hello, please do excuse my lack of knowledge with JS and JQuery but i
>> have attempted to avoid everything JS for many years as i just did not
>> like it.
>>
>> Although JQuery did make some simple aspects more manageable i still
>> try to avoid it... but sadly now i need to work with AJAX to make
>> aspects of a project more simple for its users :D
>>
>> I am currently trying to create a Username Look up function with
>> JQuery and i am trying to learn how to do this by hacking up the
>> jquery.autocomplete plugin i stumbled apon via pengoworks.com.
>>
>> But i feel im failing as i dont quite understand what is happening
>> with the script and this means im not really learning anything along
>> the way - which is not good for me in the long run as i would like to
>> finally get my head around JS ;)
>>
>> So if someone would like to step me in the right direction to what i
>> need to look at for creating a simple JQuery plugin/function that
>> would allow me to
>>
>> 1: Grab the value of a form input
>> 2: Grab results of a .php page via AJAX ( $.get()?? )
>> 3: Check through the AJAX results ( should i return the data as JSON?
>> or just | it? )
>> 4: If there is a match / likeness for what is in the form input
>> addClass('error') IF NOT addClass('accept')
>>
>> Quite simple really, but with my head my arse regarding JS im not 100%
>> sure what i should be looking to get through the points.
>>
>> If someone could just point me to the correct aspects of the API or
>> Help pages that would be great.
>>
>> Many thanks for any help and sorry if im just being a twittering
>> little JS noob :(
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Form-Input-Lookup-tf4353491s15494.html#a12406718
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to