javascript reset on close <p>I am not an expert on javascript, and I am currently trying to breakdown a previous programmer's code.</p> <p>He has a window called ADD ACCOUNT that opens up, and you can either make your selections via dropdown selects or by dragging and dropping another account directly onto the window.</p> <p>What I want to do is when the user changes their mind, and they close the window, it should automatically reset all the filters. The user is not actually hitting the reset button. They are just closing the window.</p> <p>Right now, if they close it and open it back up, the previous selection they made are still there. </p> <p>I've been looking through the code, and I found this:</p> <pre><code> var AddAccountWindow = new Ext.Window({ title: 'Add Account', closable:true, closeAction:'hide', y:5, width: 735, height:editPnlHeight-25, plain:true, layout: 'fit', stateful:false, items: AddAcountForm }); </code></pre> <p>Is there anyway I can add a reset feature that will automatically fire when they close the window with the code I provided above?</p> <p>Or do I have to create another function that will fire on close?</p>