Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7089589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:56:24+00:00 2026-05-28T07:56:24+00:00

I have JQuery dialog box for inserting new row in table. And everything works

  • 0

I have JQuery dialog box for inserting new row in table. And everything works good. Few days ago when I inserted FlexiGrid for Table started a problem for me. When I insert new row dialog dissapear but when I open dialog for new insert data that is inserted before is still in dialog.

How to reset dialog fields after I finish with it’s usage.

The code for dialog is this:

$(function() {
   $( "#dialog:ui-dialog" ).dialog( "destroy" );
        $( "#newDialog-form" ).dialog({
            autoOpen: false,
            height: 250,
            width: 300,
            modal: true,
            buttons: {
                Salva: function() {
                    $.ajax({
                      url: 'agendaTipoAppuntamentoSaveJson.do',

                      type: "POST",
                      dataType: "json",
                      data: $("#newDialogForm").serialize(),
                      success: function(result) {
                          if (result.esito!='OK') {
                              alert(result.esito + ' ' + result.message);  
                          }
                          else {
                              addNewTipoAppuntamento(
                                            result.insertedTipoApp.idTipoAppuntamento , 
                                            result.insertedTipoApp.codice, 
                                            result.insertedTipoApp.descrizione, 
                                            result.insertedTipoApp.descrBreve, 
                                            result.insertedTipoApp.colore
                             );
                             $("#newTable").flexReload(); 
                             $( "#newDialog-form" ).dialog( 'close' );
                          }
                       },
                       error:function (xhr, ajaxOptions, thrownError){
                           alert(xhr.status);
                           alert(thrownError);
                       }  
                    });
                 },
                 Annula : function() {
                   $( this ).dialog( "close" );
                 }
              }
        });

        $( "#newDialog-form" ).dialog({ closeText: ''  });
 });

This is dialog form:

<div id="newDialog-form" title="Nuovo Tipo Appuntamento" class="inputForm"   >
    <form id="newDialogForm" action="agendaTipoAppuntamentoSaveJson.do"  >
    <input type="hidden" name="azione" id="idAzione" value="update"  />
    <input type="hidden" name="idTipoAppuntamento" id="idTipoAppuntamentoIns" value="-1"  />
    <fieldset>
       <table>
            <tr >
            <td>
            <label for="codiceIns">Codice </label>
            </td><td>
            <input type="text" name="codice" id="codiceIns" class="text ui-widget-content ui-corner-all"/>
            </td></tr><tr>
            <td>
            <label for="descrizioneIns">Descrizione </label>
            </td><td>
            <input type="text" name="descrizione" id="descrizioneIns" value="" class="text ui-widget-content ui-corner-all"   />
            </td></tr><tr>
            <td>
            <label for="descrBreveIns">descrBreve </label>
            </td><td>
            <input type="text" name="descrBreve" id="descrBreveIns" value="" class="text ui-widget-content ui-corner-all"  />
            </td></tr><tr>
            <td>
            <label for="coloreIns">colore </label>
            </td><td>
            <input type="text"  name="colore" id="coloreIns" value="" class="text ui-widget-content ui-corner-all"  />
            </td>
            </tr>
        </table>
    </fieldset>
    </form>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:56:25+00:00Added an answer on May 28, 2026 at 7:56 am

    Check Dialog Close event. You will need to store the state of dialogue, state will include (title, text etc), if you are modifying it.

    Update

    After reading the comment, what I got, giving answer according to it. Please correct me if I’m wrong.

    Before you open the dailog form, store the html to local variable and then before closing it set the html back to the dialogue.

    var originalContent;
    $("#newDialog-form").dialog({
       //Your Code, append following code
       open : function(event, ui) { 
          originalContent = $("#newDialog-form").html();
       },
       close : function(event, ui) {
          $("#newDialog-form").html(originalContent);
       }
    });
    

    Hope this helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with the jquery-ui dialog box . The problem is that
I have a jquery dialog box that is used to edit and update a
I have a JQuery dialog box on a page that calls something like this:
I have a jQuery UI Dialog box, that I'm creating. It starts out as
I have a jQuery dialog box that opens and then an AJAX call is
I have a jQuery dialog box on my website. I give a div on
I have some JQuery that pops up a JQuery Dialog ( http://docs.jquery.com/UI/Dialog ) box
I have a jquery dialog modal box pop up for logging into my website.
Morning. I have a form which is rendered inside of a jquery dialog box
I have a jQuery dialog box with a form and I'd like for an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.