Question: Is there a method for me to call a function after click on the reset button in form, and I mean after, so that the form is first reset and then my function called. Normal event bubbling would call my function and only then reset the form. Now I would like to avoid setTimeout in order to do this. 

What I need is to call a function when a form is reset because I use uniform and uniform needs to be updated when values change.

At the moment I do it like this: 

```js
//Reset inputs in a form when reset button is hit  
$("button[type='reset']").live('click', function(){  
    elem = this;  
    //Sadly we need to use setTimeout to execute this after the reset has taken place  
    setTimeout(function(){  
        $.each($(elem).parents('form').find(":input"), function(){  
            $.uniform.update($(this));  
        });  
    }, 50);  
});  

```

I tried to do al this on `$(':input').change()` but reseting an element does not seem to trigger the change event.  

Thank you in advance for any help.

Answer: 
you shouldn't need to wait 50 milliseconds. If you use setTimeout with a timeout of zero, it effectively means "push this code onto the event stack". Since the form-reset is guaranteed to have fired first, the code in the setTimeout is guaranteed (in well behaved javascript interpreters) to have access to the form values you want (post-reset). You should be able to use the code below, guilt-free.

```
var afterReset = function(){
    var pushMeOntoTheEventStack = window.setTimeout(function(){
        $("#form input").each(function(){
            console.log( this.name + ' = ' + this.value );
        });
    },0);
};
$("#form").on("reset",afterReset);

```
Try this solution

Goal:

* add on "click" event
* prevent the default action (reset)
* trigger "reset"
* run desired code

Example:

```
$("button[type='reset']").on('click', function(evt) {
   evt.preventDefault();
   $(evt.target).trigger('reset');

   // enter code to run after reset
   $.each($(this).find(":input"), function(){  
      $.uniform.update($(this));  
   }); 

});

```