Return key in autocomplete menu submits form?

Events happening in the community are now at Drupal community events on www.drupal.org.
Garrett Albright's picture

Hello, all. I've run in to some odd behavior working with Ubercart - which is itself an "odd behavior," I know, but I'm hoping someone else out there may have run into it and can help me figure out how to avoid it.

Basically, I've altered in a text field on to a form which gets drawn into the page using AHAH (this involved drupal_add_js()ing autocomplete.js into the main page and then overriding an Ubercart function to call Drupal.attachBehaviors() to the stuff it adds because Ubercart's core JS doesn't add it because that's something well-written modules do). Everything works fine, except that when the Return key is used to select an item from the list (as opposed to the Tab key or using the mouse button), the form submits as it would when a normal text field has the focus.

Has anyone run in to something like this before? What's the best way to stop this behavior? Thanks in advance.

Javascript

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: