Hello... http://demo.script.aculo.us/ajax/autocompleter I have a question in reqards to the above demo... I have a list of alphanumeric values that I need in the drop down.. however... I need the ID numbers that are pulled from the db that related to each of the paticular numbers to be placed as the value... ie: <option value=234>228282SSS</option> I would like the userver to search the list based on the 228282SSS but the value is what is returned (234) ! is this possible.. and if so.. how ? Thanks so much for your time _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Siegfried Puchbauer
2006-Jul-11 10:27 UTC
Re: Auto compleater ....question about the value.
you could try returning the options that way: <option><span style="display: none">234</span><span class="informal">228282SSS</span></option> This should display 228282SSS but fill the field 234 when it is selected hth On 7/11/06, Stripe-man <remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello... > > > http://demo.script.aculo.us/ajax/autocompleter > > I have a question in reqards to the above demo... > > I have a list of alphanumeric values that I need in the drop down.. > however... > I need the ID numbers that are pulled from the db that related to each of > the paticular numbers to > be placed as the value... ie: > > <option value=234>228282SSS</option> > > I would like the userver to search the list based on the 228282SSS but > the value is what is returned (234) ! > > is this possible.. and if so.. how ? > > Thanks so much for your time > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- Mit freundlichen Grüßen Siegfried Puchbauer _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Thanks for the reply... Please forgive me.. but I should have provided the actual example of what im using (code originally from the demo page) <input autocomplete="off" id="contact_name" name="contact[name]" size="30" type="text" value="" /> <div class="auto_complete" id="contact_name_auto_complete"></div> <script type="text/javascript"> new Ajax.Autocompleter.Local(''contact_name'', ''contact_name_auto_complete'', new Array("Jack Jackson","BoB Smith", "Mary Jane"), { tokens: new Array('','',''\n''), fullSearch: true, partialSearch: true} }; </script> but what i need is to display Jack Jackson.. but return a key from a value from the db. IE if Jackjackson id # is 234 Thanks so much for any input :) On 7/11/06, Siegfried Puchbauer <siegfried.puchbauer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > you could try returning the options that way: > > <option><span style="display: none">234</span><span > class="informal">228282SSS</span></option> > > This should display 228282SSS but fill the field 234 when it is selected > > hth > > On 7/11/06, Stripe-man <remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello... > > > http://demo.script.aculo.us/ajax/autocompleter > > I have a question in reqards to the above demo... > > I have a list of alphanumeric values that I need in the drop down.. > however... > I need the ID numbers that are pulled from the db that related to each of > the paticular numbers to > be placed as the value... ie: > > <option value=234>228282SSS</option> > > I would like the userver to search the list based on the 228282SSS but > the value is what is returned (234) ! > > is this possible.. and if so.. how ? > > Thanks so much for your time > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > -- > Mit freundlichen Grüßen > > Siegfried Puchbauer > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- "I have learned that you should''nt compare yourself to others - they are more screwed up than you think." ...unknown "In the 60''s, people took acid to make the world weird. Now the world is weird and people take Prozac to make it normal." ..unknown _____________________________ Terry Remsik stripe-man.dyndns.org remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Any comment on the information provided below ? Thanks much! On 7/11/06, Stripe-man <remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks for the reply... > > Please forgive me.. but I should have provided the actual example of what > im using (code originally from the demo page) > > <input > autocomplete="off" id="contact_name" name> "contact[name]" size="30" type="text" > value="" /> > <div class> "auto_complete" id="contact_name_auto_complete"></div> > < > script type="text/javascript"> > new Ajax.Autocompleter.Local(''contact_name'', ''contact_name_auto_complete'', > new Array("Jack Jackson","BoB Smith", "Mary Jane"), > > { > tokens: new Array('','',''\n''), fullSearch: true, partialSearch: true} > }; > > </script> > > > but what i need is to display Jack Jackson.. but return a key from a value from the db. IE if Jackjackson id # is 234 > > > Thanks so much for any input :) > > > > > > On 7/11/06, Siegfried Puchbauer <siegfried.puchbauer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > you could try returning the options that way: > > > > <option><span style="display: none">234</span><span > > class="informal">228282SSS</span></option> > > > > This should display 228282SSS but fill the field 234 when it is selected > > > > > > hth > > > > On 7/11/06, Stripe-man < remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello... > > > > > > http://demo.script.aculo.us/ajax/autocompleter > > > > I have a question in reqards to the above demo... > > > > I have a list of alphanumeric values that I need in the drop down.. > > however... > > I need the ID numbers that are pulled from the db that related to each > > of the paticular numbers to > > be placed as the value... ie: > > > > <option value=234>228282SSS</option> > > > > I would like the userver to search the list based on the 228282SSS but > > the value is what is returned (234) ! > > > > is this possible.. and if so.. how ? > > > > Thanks so much for your time > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > -- > > Mit freundlichen Grüßen > > > > Siegfried Puchbauer > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > -- > "I have learned that you should''nt compare yourself to others - they are > more screwed up than you think." ...unknown > > "In the 60''s, people took acid to make the world weird. Now the world is > weird and people take Prozac to make it normal." ..unknown > _____________________________ > Terry Remsik > stripe-man.dyndns.org > remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >-- "I have learned that you should''nt compare yourself to others - they are more screwed up than you think." ...unknown "In the 60''s, people took acid to make the world weird. Now the world is weird and people take Prozac to make it normal." ..unknown _____________________________ Terry Remsik stripe-man.dyndns.org remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs