Advertisement
ExeQue

Untitled

Nov 28th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function () {
  2.     $('form').each(function () {
  3.         var self    = $(this),
  4.             submits = self.find('[type=submit]');
  5.  
  6.         self.find('input, textarea, select').bind('change input keydown keypress', function (e) {
  7.             submits.attr('disabled', self[0].checkValidity() ? null : true)
  8.         }).keydown();
  9.  
  10.         self.find('[type=reset]').click(function () {
  11.             self.find('input, textarea').removeClass('dirty');
  12.         });
  13.     });
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement