I had to modify the updateElement method to trim the spaces.

Change this:
this.element.value = value;

To this:
this.element.value = value.replace(/^\s*|\s*$/g,"");


Not sure why that wouldn't be there already.

Daniel Elmore


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Kaspick
Sent: Tuesday, May 23, 2006 3:14 PM
To: [email protected]
Subject: Re: [Rails-spinoffs] script.aculo.us AutoComplete Woes

I have used the informal class on my own stuff (which works), but when
I select an item, some whitespace is added before the selected text.
It actually appears to be newlines that are being inserted into the
textfield.

Any ideas what may be causing this?  Would this occur because of extra
spacing in the markup I'm sending back from the server?  I tried
removing some, but it didn't seem to have an affect.

Thanks

On 12/6/05, Daniel Elmore <[EMAIL PROTECTED]> wrote:
> Good! Thank you, that works!
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Cam
> McVey
> Sent: Tuesday, December 06, 2005 4:10 AM
> To: [email protected]
> Subject: Re: [Rails-spinoffs] script.aculo.us AutoComplete Woes
>
> Hi Daniel,
>
> You have to wrap up anything you DON'T want to appear in the text box
> in a span tag with a class of 'informal'. For example:
>
> [ul]
>   [li]John Smith<br />[span class="informal"[EMAIL PROTECTED]/span][/li]
> [/ul]
>
> Regards,
> Cam
>
> On 12/6/05, Daniel Elmore <[EMAIL PROTECTED]> wrote:
> > I was wondering if someone could help me with an autocomplete problem.
> I
> > have the autocomplete div receiving a <UL> that looks like:
> >
> > <ul>
> >   <li>Name<br>Email</li>
> > </ul>
> >
> > When the user hits enter and the value is filled into the text field
> > it's putting both the name and email in the field. I just want the
> name.
> <snip>
>
> _______________________________________________
> Rails-spinoffs mailing list
> [email protected]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to