codedance / jquery.AreYouSure

A light-weight jQuery "dirty forms" Plugin - it monitors html forms and alerts users to unsaved changes if they attempt to close the browser or navigate away from the page. (Are you sure?)
508 stars 145 forks source link

Fire off dirty event #56

Closed DevanB closed 9 years ago

DevanB commented 9 years ago

Is there a way to specifically fire off a dirty event?

I have a calendar widget that when it's value is changed I add the 'dirty' class to the form. Works great, but I also have some save buttons that are disabled unless the form is dirty. I'm disabling/enabling the buttons via the dirty/clean events being fired, which don't get fired (obviously) when I add the 'dirty' class to the form.

So wondering if I can fire off the dirty/clean events from within another function.