Hi

I'm new to jQuery and to this list. This is a question I sent to
another web developer's list yesterday, after spending many hours
trying and failing to get the Autocomplete (http://docs.jquery.com/
Plugins/Autocomplete) jQuery plugin to do what I wanted:

~~~~~~~~~
Ok, I give in - I've been staring at a screen for 5 hours now trying
to find a good autocomplete function/plugin/module/wossname for a
database entry form. A decent candidate is the jQuery Autocomplete
plugin which I've sort of got working on a test doc (http://
www.nottingham.ac.uk/~ntzfr/test/ajax/jquery/jquery_test1.html).
What I'd like to do is autosuggest for keywords pulled from a mySQL
table as id|title ('select id, title from keywords order by title' or
somesuch). So the autocomplete shoves title into the input field, but
I can't figure out, because my brain's gone dead, how to get the id.
Store it in a hidden field, perhaps, but how to do that using this
component and/or jQuery?

If anyone's using this component my hurting brain would be grateful
for a tip :(
~~~~~~~~~

Maybe the result() handler might do the job, but in order to
understand how that works I'd have to understand jQuery properly,
which would take another good few hours on top of the few I've spent
on it already, all for a user interface 'grace note', and I don't have
that sort of time. The author of this plugin suggested posting
problems to this board with [autocomplete] in the subject, so here we
go.

There are other autocomplete Ajax scripts but all have their problems,
mostly due to reliance on Ajax frameworks I know little of and don't
have the time to learn (MooTools, Ruby on Rails, script.aculo.us,
Sajax, and many more), sometimes due to requiring data output from a
PHP script in XML and/or JSON which would be a step too far. I think I
understand basic Ajax, at least the XHR bit (test at
http://www.nottingham.ac.uk/~ntzfr/test/ajax/), and can get data from
PHP, it's the drop-down eye-candy that defeats me. My past experience
with JS/DOM is that it can take hours, days to implement the simplest
things, hence my turning to jQuery to try to speed up development and
reduce headaches, without much success so far.

Any suggestions? All would be gratefully received and picked over. If
not I'll knock it on the head and the user can do their own damn
typing ;-(

Cheers

Fred

Reply via email to