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?)
507 stars 145 forks source link

Add 'checkDisabled' and 'checkAttrName' settings #83

Open jordisan opened 9 years ago

jordisan commented 9 years ago

Add a setting to make it possible enable/disable disabled fields checking. Useful since 'propertychange' event is not supported by most browsers, so if you change the "disabled" attribute programmatically, the plugin doesn't work properly

Add a setting to make it possible enable/disable checking whether field has 'name' or not. Useful if you are using AJAX, in which case you might have fields without "name" that you want to track

codedance commented 9 years ago

checkDisabled sounds reasonable and is in effect self documenting.

I think checkAttrName could be more appropriately named and/or document. Maybe checkUnnamed?

History: Unnamed fields are not sent on form submits and hence are ignored. It does however make sense for the AJAX case you've put forward so it's a reasonable change.

I'll merge once we've decided on the most appropriate name. Getting the external API/names are important as they are hard to retrospectively change!