1

i am building a page that once i click on a link it call's the function modal and the url of the page to be oppened on the dialog, the page that load's in the dialog contains a form , the problem is that once i submit the form the dialog closes instead of maintain the dialog open.

is is possible to maintain the dialog open once the form has been submitted from the dialog page?

below there's the jquery code:

thanks

$(document).ready(function() {
    $("#dialog").dialog({
        autoOpen: false,
        modal: true,
        width: 400,
        height: 400,
        close: function(event, ui) {
            $("#dialog").html("");
        }
    });
});

function modal(url) {
    $(document).ready(function() {
        $("#dialog").load(url).dialog('open');
    });
}​

1 Answer 1

1

You can add your own event on submit

$(document).ready( function() {
    $('#commentform').submit( function() {
        // submit data with $.POST, $.GET, $.AJAX
        return false;
    });
});

'commentform' - id of your form into 'dialog'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.