On one of my tabs, I have a contact form, which I'm submitting using
the ajaxForm plugin.

On submission of the form, it displays a dialog with the results.

Problem, it's creating two of the dialogs on top of each other.

I have a function to create the dialog onload.

function createDialog(element){
        $(element).dialog({
                        modal: true,
                        autoOpen: false,
                        show: 'slide',
                        hide: 'slide',
                        buttons: {
                                Ok: function() {
                                        $(this).dialog('close');
                                }
                        }
                });
}

Then the ajaxForm opens the dialog, updating the dialog information as
it loads

var formoptions = {
        target:        '.formresponse',   // target element(s) to be
updated with server response
        //beforeSubmit:  showRequest,  // pre-submit callback
        success:       function(){
                        $(".formresponse").dialog('open');
                        }// post-submit callback

        // other available options:
        //url:       url         // override for form's 'action'
attribute
        //type:      type        // 'get' or 'post', override for
form's 'method' attribute
        //dataType:  null        // 'xml', 'script', or
'json' (expected server response type)
        //clearForm: true        // clear all form fields after
successful submit
        //resetForm: true        // reset the form after successful
submit

        // $.ajax options can be used here too, for example:
        //timeout:   3000
    };
        $('.submitform').ajaxForm(formoptions);

The latter is inside a $(function(){}); to initialize the form.

I'm not sure why I'm getting two copies of the Dialog loading when I
submit the form inside tab. Thoughts?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to