How to reset textbox values in dialog after destroy?

Posted by user281180 on Stack Overflow See other posts from Stack Overflow or by user281180
Published on 2010-05-13T06:51:18Z Indexed on 2010/05/13 6:54 UTC
Read the original article Hit count: 177

Filed under:

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>

© Stack Overflow or respective owner

Related posts about jQuery