Guest User

Untitled

a guest
May 22nd, 2012
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Call a function after form reset
  2. <form>
  3. <div id="capture_bubble">
  4. <input type="text"><input type="reset">
  5. </div>
  6. </form>
  7.  
  8. (function($) {
  9. $(function() {
  10. $('#capture_bubble').live('click', function(){
  11. console.debug('capture_bubble');
  12. alert('capture_bubble')
  13. })
  14. $("input[type='reset']").live('click', function(){
  15. this.form.reset(); // forcing reset event
  16. console.debug('reset');
  17. alert('reset')
  18. });
  19. });
  20. })(jQuery);
  21.  
  22. function updateForm()
  23. {
  24. $.each($('form').find(":input"), function(){
  25. $.uniform.update($(this));
  26. });
  27. }
  28.  
  29. <form onReset="updateForm();">
  30.  
  31. $('form').bind('reset', function() {
  32. $.each($(this).find(":input"), function(){
  33. $.uniform.update($(this));
  34. });
  35. });
Advertisement
Add Comment
Please, Sign In to add comment