This is kind of hackish but it works.
On the page I have a dialog set up like this.
Then in the $(document).ready(...) method I do this. The meat of the example is using the jQuery Event object's preventDefault and stopPropogation. The preventDefault stops the click event while stopPropogation prevents the event from bubbling up the DOM. After that you can handle the dialog however you want.
There's probably a better way of finding and submitting the required form I just coded this quickly. Also note that were using full page post backs and not AJAX.