acvwilson / dirty_form

A jQuery plugin for alerting users to unsaved changes to forms before they leave a page or tab...
GNU General Public License v2.0
73 stars 7 forks source link

clean_form() is not working correctly #5

Open etiennelb opened 13 years ago

etiennelb commented 13 years ago

Hi,

In clean_form() method, you're calling dirtyform.reset() :

 if(dirtyform.is('form')) {
   dirtyform.reset().find('.changed:input').each(function(){
     $(this).trigger($.DirtyForm.monitorEvent + '.dirty_form');
   });
 }

A javascript error occurs :

 dirtyform.reset is not a function

It seems that the reset() function exists only in javascript form object but not in jQuery objects.

I removed the reset() call and it worked. Thank you for your plugin.