how to reset textbox values in dialog after destroy

how to reset textbox values in dialog after destroy

I have a dialog in which there are 2 textboxes.  I want to reset the textboxes values once the dialog is destroyed. How can I do that?
 
 If I have entered values in the textboxes and clicked cancel, reopening the dialog will show the data entered previously.
 
 
 
  1. function setDialogWindows($element) {

    $(

    '#change').dialog({

    autoOpen:

    true,

    width: 380,

    buttons: {

    "Cancel": function() {

    $(

    this).dialog('destroy');

    },

    "Accept": function() {

    } }): }

 

  1. $(

    '#link').click(function() {

    setDialogWindows('#change');

    });
 
  1. <

    div id="change" title="Change password" >

    <input type="hidden" id="User_Name" name="Name"/>

    <input type="textbox" id="text1" /> <input type="textbox" id="text2" />
    </div>