JQuery UI dialog modal form caching old values in AJAX application

后端 未结 2 918
醉话见心
醉话见心 2021-02-20 01:20

I am having a major headache using a form in a modal dialog with JQuery UI. The dialog is displayed when the user clicks on a link. The first time the form is opened, it works f

相关标签:
2条回答
  • 2021-02-20 01:35

    From what I could interpret from your code, you are not actually removing the previous forms. You are just removing the dialog from them.

    The method is described as:

    Remove the dialog functionality completely. This will return the element back to its pre-init state.

    Meaning its still there.

    Try this (note the $('#divForm').remove();):

     $.post('/Item/Save', postData, function (response, status) {
                $('#divForm').remove();
                $('#divContent').html(response); //response mark up contains a new 'divForm' element
            }, 'html');
        }
    
    0 讨论(0)
  • 2021-02-20 01:48

    With my solution i'm using

    dialog('destroy') instead dialog('close')

    0 讨论(0)
提交回复
热议问题