2 things to try...

1) You could try using the document.onkeydown event to capture all enter
keystrokes and submit the form before the autocompleter calls
updateElement.

2) Try providing an updateElement function to the autocompleter which
checks if the keystroke was an enter and either submits or completes.
Because the event is not tossed into function i'm not sure how to go
about capturing the event in some browsers but window.event.keyCode
works IE I believe ( Is IE actually better in this respect ? ). I'm sure
firefox has a way. 

> > Hi,
> >
> > I have an ajax auto completer for a text field in a form. All's
good.
> >
> > Unfortunately, I also want the form to be submitted when the user 
> > hits 'return' in the text field.
> >
> > This combination of circumstances means that if the user is typing 
> > his entry and then hits return to submit it is possible that dang 
> > auto completer will pop up and complete his entry for even if he 
> > doesn't want it completed.
>
> I had this issue myself, and unfortunately couldn't find an exact 
> solution to it.  I was able to make the autocompleter come up without 
> a selection, but if the mouse pointer was hovering over where the 
> autocompleter box was supposed to be, it triggered the mouseover event

> and selected the item.  If anyone has a solution for that, I'd love to

> hear it :))
>
> -Jeremy
>
> --
> Jeremy Kitchen ++ [EMAIL PROTECTED]
>
> http://www.pirate-party.us/ -- defend your rights
>
>
> _______________________________________________
> 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