Update: I've modified the suggested JavaScript code to not break #autocomplete enter presses.
The #ahah
element introduced in Drupal 6 makes setting up dynamic JavaScript-driven forms much simpler than with Drupal 5. To see this in action, take a look at the Poll module. When adding more choices to a form, clicking the "Add another choice" button doesn't reload the page if JavaScript is enabled. However, there is one problem with such a form: by adding a submit button above other submit elements, it becomes the default action when pressing the enter key. Unfortunately, browsers don't have a method to specify the default submit action, and usually just use the first submit element on the form. To see this issue, try pressing the enter key inside the Title field on a Poll node. The page reloads, and the JS-disabled fallback is executed, instead of the Preview action as may be expected.
This might be behaving as intended with the Poll module, but I wanted to ensure that the enter key action was consistent with a similar feature I was adding to the Skeleton Outline module. Most JavaScript code online will recommend doing something similar to the following: