On 06 Oct 2006, at 07:45, gaurav bagga wrote:> hi all, > i have implemented live search using scriptulous and i am getting > the list > > the problem is that when i select an item from the list white > spaces gets appended in front " item" of the selection in firefox > and in opera > front and behind " item " > > i printed the value in console and saw it gives "item" but in > textbox after selection whitespaces gets appended > > > any idea what can be wrong anyone faced similar problem > > or is it that something is wrong the way i have implemented >I''ve had to cope with the same thing. I just stripped off the surrounding space before using the autocomplete value. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
hi peter, can you just explain where u made the changes is it like using js event you take the value from textbox strip it of and then put it back or theres a ruby way ??? regards gaurav On 10/6/06, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > > On 06 Oct 2006, at 07:45, gaurav bagga wrote: > > hi all, > i have implemented live search using scriptulous and i am getting the > list > > the problem is that when i select an item from the list white spaces gets > appended in front " item" of the selection in firefox and in opera > front and behind " item " > > i printed the value in console and saw it gives "item" but in textbox > after selection whitespaces gets appended > > > any idea what can be wrong anyone faced similar problem > > or is it that something is wrong the way i have implemented > > > I''ve had to cope with the same thing. I just stripped off the surrounding > space before using the autocomplete value. > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 06 Oct 2006, at 11:20, gaurav bagga wrote:> can you just explain where u made the changes > > is it like using js event you take the value from textbox strip > it of and then put it back or theres a ruby way ???Out of my head: in my controller method "search", I have something like: @results=Model.find_by_something(params[:query].chomp.strip) Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
hi, i found that from controller the value was coming fine i made changes in "updateElement: function(selectedElement) " added "this.element.value = (value.replace(/^\W+/,'''')).replace(/\W+$/,''''); " in controls.js it worked regards gaurav On 10/6/06, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > > On 06 Oct 2006, at 11:20, gaurav bagga wrote: > > can you just explain where u made the changes > > is it like using js event you take the value from textbox strip it of > and then put it back or theres a ruby way ??? > > > Out of my head: > > in my controller method "search", I have something like: > > @results=Model.find_by_something(params[:query].chomp.strip) > > > > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
hi all, i have implemented live search using scriptulous and i am getting the list the problem is that when i select an item from the list white spaces gets appended in front " item" of the selection in firefox and in opera front and behind " item " i printed the value in console and saw it gives "item" but in textbox after selection whitespaces gets appended any idea what can be wrong anyone faced similar problem or is it that something is wrong the way i have implemented regards gaurav -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20061006/bd6b06fe/attachment.html