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:
- $(document).ready(function() {
- $('#vemail a').each(function() {
- var $link = $(this);
- var $dialog = $('<div></div>')
- .load($link.attr('href'))
- .dialog({
- autoOpen: false,
- title: $link.attr('title'),
- width: 500,
- height: 300
- });
- $link.click(function() {
- $dialog.dialog('open');
- return false;
- });
- });
- var options = {
- target: '#output',
- success: function() {
- $('#output').fadeIn('slow');
- }
- };
- $('#form_email').submit(function() {
- $(this).ajaxSubmit(options);
- return false;
- });
- });
I have also tried using ajaxForm with the same result. Where have I gotten off base?
Thnaks.