form-change-tracker

Version 0.5.1 (06/21/2017)
Price: Free / Donations

Related links

form-change-tracker is a small (roughly 1.5 kB gzipped), dependency-free JavaScript browser library for keeping track of the state (pristine vs. changed) of controls in a DOM-based form.

Using this state (i.e.: via CSS class names added or removed from controls and their associated <label> elements), you can provide visual feedback regarding which controls have changed and which have not. Of course, it will detect if an element is first changed and then changed back to its initial value. Additionally, form-change-tracker automatically manages disabling or enabling a reset button, if there is one in the form.

This library is probably not what you need in a project where you already are using some SPA framework (React, Angular, Vue or the like), but is a nice addition for “classical” mainly server-driven applications.

The library comes in UMD flavour, so you can …

  • use it directly (<script> tag in the browser)
  • use it via the AMD module format (Require.js)
  • use it via the CommonJS module format (Node.js)