coyote999
Posts: 22
|
| Posted: 07/07/2008, 3:27 AM |
|
Hello!
I need help for the new AJAX-Feature "Autocomplete"
There's a table like "City_ID, Cityname"
The Autocomplete-Search column is of course "Cityname", but
how can i submit the Value "City_ID" for the selected Cityname?
Thanks for help!
Martin
|
 |
 |
TheunisP
Posts: 342
|
| Posted: 07/30/2008, 6:18 AM |
|
*bump*
I would also want to know
|
 |
 |
maxhugen
Posts: 272
|
| Posted: 07/31/2008, 6:49 PM |
|
I thought I wouldn't mind a solution to this one either, so I had a bit of a look at the CCS example to see what's going on.
Basically, the pt/scriptaculous function 'Autocompleter' that provides the 'drop down list' only returns one field. We'd really need 2 - the second being the ID field, which should be hidden. Not being an expert, I don't see a way around that, short of writing your own function to do this - and probably custom coding the whole AutoComplete procedure. Yuk!
The CCS example itself will not work properly if there is more than one employee with the same name, eg 'John Smith'. Entirely possible!
My suggestion - untried, as I haven't the time - would be to create a concatenated field of City + State + Zipcode right from the start in your Record's data source. Then use this as the basis for the AutoComplete.
Based on this concatenation, it should bring back a unique record - I think. 
Note that once the record has been retrieved, you'll have the city_id in, presumably, a hidden field.
HTH!
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
|