No ideas?
On 6/8/07, Nicolas Terray
<nicolas.terray-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> Working with Ajax.Autocompleter, I would like to show automatically
> the end of the text inside the input after selection.
> For example:
> - my entry is
"rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org"
> - the input show only 10 characters
> - only ten characters will be displayed after selection : [rails-spin]
> => I would like the 10 last characters displayed : [nrails.org]
>
> I tryed this piece of code but it does nothing on Firefox 1.5 and 2.0
:''(
> afterUpdateElement: function(element) {
> var p = element.value.length;
> if (element.setSelectionRange) {
> setTimeout(function () {
> this.setSelectionRange(p, p);
> }.bind(element), 10);
> } else if (element.createTextRange) {
> var range = element.createTextRange();
> range.collapse(true);
> range.moveEnd(''character'', p);
> range.moveStart(''character'', p);
> range.select();
> }
> }
>
> Have somebody understood my needs? It''s a little bit difficult to
explain...
>
> Thanks for help,
> Nicolas
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---