Dialog UI and Ajax Submit Form Problem

Dialog UI and Ajax Submit Form Problem

I have a UI Dialog that contains a form. All form data is in the dialog. I want to  ajax submit the form so I get the response in the dialog. The dialog works and the form submits. The problem is that I get the form processing page displayed rather than the data displayed in the dialog. I am using UI 1.7.2, the forms plugin and jQuery 1.3.2. I have also tried with jQuery 1.4.1. Here's the working code:

  1. $(document).ready(function() {
  2. $('#vemail a').each(function() {
  3. var $link = $(this);
  4. var $dialog = $('<div></div>')
  5. .load($link.attr('href'))
  6. .dialog({
  7. autoOpen: false,
  8. title: $link.attr('title'),
  9. width: 500,
  10. height: 300
  11. });
  12. $link.click(function() {
  13. $dialog.dialog('open');
  14. return false;
  15. });
  16. });
  17. var options = {
  18. target: '#output',
  19. success: function() {
  20. $('#output').fadeIn('slow');
  21. }
  22. };
  23. $('#form_email').submit(function() {
  24. $(this).ajaxSubmit(options);
  25. return false;
  26. });
  27. });
I have also tried using ajaxForm with the same result. Where have I gotten off base?

Thnaks.