preventDefault() was working for everything but FF2 on Mac. I just
came up with a solution that works, but perhaps Jörn could provide
some input whether this is the best way to handle it.

In jquery.autocomplete.js, in addition to the existing check for
Opera, I added a check for Firefox 2:

  // prevent form submit in opera when selecting with return key
  // Original: $.browser.opera && $
(input.form).bind("submit.autocomplete", function() {
  // New:
  ($.browser.opera || ($.browser.mozilla &&
jQuery.browser.version.substr(0,3)=="1.8")) &&
    $(input.form).bind("submit.autocomplete", function() {
      if (blockSubmit) {
        blockSubmit = false;
        return false;
      }
  });

On Sep 19, 11:24 am, ricardobeat <[EMAIL PROTECTED]> wrote:
> I believe this happens for windows users as well, 'enter' always
> submits the form except inside textareas. Or maybe I have a very bad
> memory.
>
> naumanp wrote:
> > I'm using Autocomplete 1.0.2 (5747 2008-06-25 18:30:55Z
> > joern.zaefferer).
>
> > This happens in Firefox 2.0.0.16 on OS X (I'm running 10.5.5).
> > Does *not* happen in Firefox 2 on XP, Firefox 3 on XP & Mac, Safari 3,
> > IE6, IE7.
> > I tried it on two different Macs with the same result.
>
> > This can be reproduced even on the demo page:
> >http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/
>
> > Any ideas why this is happening and how to fix it?

Reply via email to