Enter Key Event Bubbling Up from jQuery Modal Dialog

Enter Key Event Bubbling Up from jQuery Modal Dialog

(Also posted this in "Getting Started" forum, but it looks to me as though this forum gets a lot more attention than the other one, so I'm posting it here, too.)

I have searched for an answer to my question, thinking that it is a common problem -- but to no avail.  Here's my problem:

I have a page where I have attempted to convert one of my old javascript alert dialogs to a jquery dialog.  The dialog comes up just fine.  And if I click on the "Ok" button, the dialog closes as it should. However, if I press ENTER, the dialog closes and then the Enter key event bubbles up and is captured by another function which submits the form.

I have spent part of yesterday and all of today searching for solutions to this seemingly simple problem -- all in futility.  I have tried using the stopPropagation() and stopImmediatePropagation() methods in event-handling functions bound to the dialog div.  But I can't seem to stumble on any method to prevent the Enter Key Event from bubbling up from the jQuery dialog to the form from which it was called.  

I am a jQuery novice, and I absolutely LOVE what I have learned so far -- I really want to learn how to use jQuery well.  It is absolutely the most elegant programming tool I have ever come upon in my 25+ years of programming.  But at this point I am so frustrated that I am just about ready to cut my losses and restore the ugly javascript alert dialogs.

There simply MUST be an easy solution to this problem! But I can't seem to find it.

Can anyone help me out here?

Thanks ...