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.
function setDialogWindows($element) {
$('#change').dialog({
autoOpen: true,
width: 380,
buttons: {
"Cancel": function() {
$(this).dialog('destroy');
},
"Accept": function() {
}
}):
}
$('#link').click(function() {
setDialogWindows('#change');
});
<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>