Here are a couple things you might try:
1. make sure your <form> is completely contained within your #dialog element

2. call .ajaxForm after the dialog is opened, like so:

$("#dialog").dialog({
  bgiframe: true,
  autoOpen: false,
  width: 620,
  modal: true,
  open: function(event, ui) {
    $('#myForm2').ajaxForm(function() {
      alert("Thank you for your comment!");
    });
  }
});

I'm guessing the issue you're seeing may be related to the fact the a dialog
is placed at the end of the body when it is opened to get around a stacking
issue in IE. If that doesn't do it:

3. Try with modal: false instead of modal: true

4. Try your code without a dialog at all, to make sure your .ajaxForm is
working

If none of those work, please share a sample page or reproduce one on
jsbin.com:

http://jsbin.com/

Thanks.

- Richard

On Tue, Aug 11, 2009 at 5:30 PM, apadley <apad...@gmail.com> wrote:

>
> I am using the Dialog UI and want to post a very simple form. In add
> browsers tested (Windows & Mac), the form data does post to the action
> page, but there is no response so the callback fails. However, one Mac
> G5 computer running 10.5.8 and Firefox 3.5.2 or Safari 4.0.2
> everything works perfectly. Data posts properly and I receive the
> anticipated response triggering the callback.
>
> Looking at Firebug (novice user here) I see a discrepancy between the
> one computer that works and the others that don't. On the G5 that
> works, under the Net tab, I see the normal "POST" designation followed
> by the action page's url. On all other computers (various Macs and
> Windows) "POST" is missing and is replaced by "OPTIONS". I haven't
> been able to figure out what that means. Anyway, the jquery code is
> below and I'd appreciate comments.
>
> $(document).ready(function() {
>                $('#myForm2').ajaxForm(function() {
>                alert("Thank you for your comment!");
>            });
>
>                $("#dialog").dialog({
>                        bgiframe: true,
>                        autoOpen: false,
>                        width: 620,
>                        modal: true
>                });
>
>                $('#create-user').click(function() {
>                        $('#dialog').dialog('open');
>                });
>
>        });
>

Reply via email to